Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

OO-style modifiers for 'sub' ?

by Gilimanjaro (Hermit)
on Jan 24, 2003 at 17:10 UTC ( [id://229640]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub foo {
        my $self = shift;
    ...
            $self and ref $self and $self->isa(__PACKAGE__);    
        # actual body of code
    }
    
  2. or download this
    method sub {}              # $SELF=shift, check $SELF & isa
    instance method sub {}     # =method modifier + ref $SELF
    class method sub {}        # =method modifier + !ref $SELF & /\W/ & de
    +fined namespace
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://229640]
Approved by footpad
Front-paged by footpad
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2024-03-29 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found