Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: How do I write subs that take bare blocks as args?

by DamnDirtyApe (Curate)
on Jun 28, 2002 at 06:20 UTC ( #177945=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub each_item (&@)
    {
    ...
        foreach ( @_ ) { return 0 unless ( eval &$test ) }
        return 1 ;
    }
    
  2. or download this
    sub each_item (&@)
    {
    ...
        foreach ( @_ ) { return 0 unless &{$test} }
        return 1 ;
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2016-07-31 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (269 votes). Check out past polls.