Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: on the fly methods

by Rhandom (Curate)
on Feb 27, 2007 at 21:07 UTC ( [id://602388]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Scalar::Util qw(blessed);
    my $is_code = blessed($code) ? $code->can('&{}') : ref($code) eq 'CODE
    +';
    
  2. or download this
    my $is_code = ! blessed($code)
                ? ref($code) eq 'CODE'
                : $code->can('&{}')
                  || $code->isa('CODE') # arguably not a good test (bless 
    +{}, 'CODE')
                  || eval { defined &$code }; # arguably bad because it ge
    +ts called in some contexts
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-20 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found