Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Perl Objects

September 28, 1998

To instantiate an object from a class, you need only call the class' "new" method such as:

     $new_object = new ClassName;

For example,

     $new_cat = new Cat("Fred", "white");

When you do so, the new() subroutine in that Cat class will be called. As you recall, the new() subroutine created a reference to an anonymous hash, blessed the reference, and returned it. Thus, $new_cat will store the pointer to your cat object.

So once you have instantiated an actual cat object, you will need to know how to do things with it. How can I make Fred say "meow"?

Defining a Class
Introduction to Perl 5 | Table of Contents
Using Methods



Up to => Home / Authoring / Languages / Perl / 5




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers