![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Post-declared subs are always resolved as long as Perl knows that it's a sub, that's why Perl5 introduced the "new syntax" ° with parenthesis func()
Pre-declaration is only necessary when avoiding parens in bareword use, like func 1,2,3 because otherwise Perl can't tell at the first parse if its a sub-call or not. A pre-declaration placeholder can be done by a body-less sub NAME; or with the pragma use subs LIST for multiple names. Using &ersands just to spare parens() has too many side-effects and should be limited to cases which can't be resolved by pre-declaration.
Cheers Rolf °) "new" as in "new york", "new model army" or "Bojo Churchill". In reply to Re^2: why avoid & on function call (pre-declaration)
by LanX
|
|