Considering this code:
#!/usr/bin/perl
package p1;
use Data::Dumper;
sub dump_it {
print Dumper @_
}
package p2;
local *foo = *p1::dump_it;
foo('this works');
#local *foo = *p1::dump_it("but this doesn't");
#foo;
I kind of understand, why passing a parameter here can't work, however I think it would be quite practical in some situations. Is there a way to make something similar to the commented-out part function? I would not want to wrap the dump_it in another sub, but directly use a reference.