Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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.