Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

OO-style modifiers for 'sub' ?

by Gilimanjaro (Hermit)
on Jan 24, 2003 at 17:10 UTC ( #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
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? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2015-07-28 09:06 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 (254 votes), past polls