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

Re^3: OO-style modifiers for 'sub' ?

by adrianh (Chancellor)
on Jan 25, 2003 at 14:43 UTC ( #229846=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Class::method($self); # called as a subroutine
    $self->method;        # called as a method
    
  2. or download this
    use Devel::Caller qw(called_as_method);
    
    ...
       croak "I am an instance method" unless called_as_method(0);
       # actual body of code
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2018-11-15 19:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (191 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!