in reply to How to pass parameters to anonymous subs and sub references?
For q1, all you need is parens:
As for q2: Do you have an anonymous sub? What's it look like? In the typical situation, you have a ref to the sub, e.g.(\&test)->(1);
in which case you do as you already showed:my $ref = sub { print "(@_)\n" };
If not that, then what?$ref->(1);
|
|---|