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

Re: Passing subroutines as arguments

by chip (Curate)
on May 08, 2003 at 19:45 UTC ( [id://256650]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub call_twice {
        my $func = shift;
        &$func("first");
    ...
    call_twice(\&foo);
    
    call_twice(sub { print "bar: @_\n" });
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-20 01:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found