Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

(lang: nl) Objecten voor beginners

by Juerd (Abbot)
on Dec 17, 2001 at 04:11 UTC ( #132425=perltutorial: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
     package Foo;
    
  2. or download this
     sub new {
         my $package = shift;
    ...
         bless $object, $package; # De magie
         return $object;
     }
    
  3. or download this
     my $object = Foo->new;
     # of
     my $object = new Foo;
    
  4. or download this
     package Schaap;
    
    ...
     $dolly->blaat('Hallo');         # Schaap::blaat($dolly, 'Hallo')
     blaat $dolly('Ook dit werkt');  # Schaap::blaat($dolly,
                                     # 'Ook dit werkt');
    
  5. or download this
     sub kleur {
         my ($self, $kleur) = @_;
    ...
    
     $obj->kleur("Blauw");
     print "De kleur is ", $obj->kleur(), ".\n"; # De kleur is blauw.
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2015-07-31 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (276 votes), past polls