in reply to Passing subroutine as argument between packages
Valid usage this function: $FooConfig->important_func, but reference return &PackageName:: before
I'm not sure I understand what your problem is. As it seems, you appear to have figured out that the correct way to call the method would be $FooConfig->important_func( ... ). So where/when are you getting the &PackageName:: you don't want?
Upon rethinking, maybe you want something like this
which would 'bind' the object instance and the method parameter to the coderef, so that you could call it later on as $ref->().my $ref = sub { $FooConfig->important_func( '1' ) };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing subroutine as argument between packages
by Mateusz (Initiate) on Nov 30, 2011 at 18:13 UTC | |
by chromatic (Archbishop) on Nov 30, 2011 at 18:25 UTC | |
by Mateusz (Initiate) on Nov 30, 2011 at 18:43 UTC |