Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Passing references to subroutines with parameters

by lhoward (Vicar)
on Jul 12, 2001 at 22:21 UTC ( #96138=note: print w/replies, xml ) Need Help??


in reply to Passing references to subroutines with parameters

You can do this by changing your call slightly and creating an anonymous subroutine:
sub_to_receive('123', sub {sub_to_be_passed('xyz',@_)});
Effectively, you're creating a new (anonymous) subroutine that calls sub_to_be_passed with the first argument already filled in and the others coming from what is passed to the anonymous subroutine when it is called.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2019-08-20 09:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?