Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: perl oop concept

by tobyink (Abbot)
on Dec 04, 2012 at 07:07 UTC ( #1007022=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package a;
    
    ...
    }
    
    my $obj = new a ();
    
  2. or download this
    my $obj = "a"->new();
    
  3. or download this
    $obj ->{$self}{avalue}=10;
    print $obj->{$self}{avalue};
    
  4. or download this
    {
      package a;
    ...
    my $obj = "a"->new();
    $obj->avalue(10);           # set
    print $obj->avalue, "\n";   # get
    
  5. or download this
    {
      package a;
    ...
    my $obj = "a"->new();
    $obj->avalue(10);           # set
    print $obj->avalue, "\n";   # get
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007022]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (15)
As of 2014-07-11 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (232 votes), past polls