in reply to why avoid & on function call
IIRC it has now a bunch of side effects like°
This can be very useful in edge cases <1‰, but will more likely cause trouble in normal use.
The only time you can't avoid &sigils in standard Perl5 is when referencing a named function ˛
$code_ref = \&sub_name
More in perlsub ...
HTH :)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
°) other use case are:
E.G. like when wanting to use AUTOLOAD while avoiding parenthesis for syntactic sugar.
E.g. CGI.pm used to have a sub &tr for HTML's "table row" tag which collided with Perl's tr (IIRC)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: why avoid & on function call (updated x 3)
by Anonymous Monk on Dec 28, 2020 at 19:38 UTC | |
by LanX (Saint) on Dec 28, 2020 at 20:14 UTC |