Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 surveying the Monastery: (14)
As of 2014-07-31 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (250 votes), past polls