in reply to Re^4: $_ functions vs argument-using functions
in thread $_ functions vs argument-using functions
The point is you can't reuse this coding style very often, so better avoid it.
You can write sub func (&@) { } to use block syntax. like in func {shift()+1 } 1..10
Or you can directly pass function references f(\&g(\&h),1..10)
or anonymous subs f(sub {...},1..10)
without using prototypes at all.
But Perl won't allow you to rewrite anything like func EXPR, LIST acting like map does.
And as I said have a look into HOP.
Please understand that I won't go further into details of a theoretical discussion, I'd rather prefer to see a real use case from you such that we can recommend the Perl way to do it.
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|