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

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://229640]
Approved by footpad
Front-paged by footpad
[Lady_Aleena]: atcroft, the whole link thing might be a question for either or both the CPAN sites. search.cpan is cpansearch@perl. org, and metacpan doesn't have an email addy for the website itself.
Lady_Aleena just followed @metacpan on Twitter.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2017-05-27 04:31 GMT
Find Nodes?
    Voting Booth?