Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Passing subroutine as argument between packages

by chromatic (Archbishop)
on Nov 30, 2011 at 18:25 UTC ( #940917=note: print w/replies, xml ) Need Help??


in reply to Re^2: Passing subroutine as argument between packages
in thread Passing subroutine as argument between packages

Given:

my $ref = sub { $FooConfig->important_func( '1', @_ ) };

... then you can write:

$ref->( 'more', $args, %here );

... though be cautious and understand how the function reference passes its arguments to the inner function.


Improve your skills with Modern Perl: the free book.

Replies are listed 'Best First'.
Re^4: Passing subroutine as argument between packages
by Mateusz (Initiate) on Nov 30, 2011 at 18:43 UTC

    Simple @_ is solution - now works fine!

    Thanks for very helpfull hints.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://940917]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2017-04-26 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (492 votes). Check out past polls.