http://www.perlmonks.org?node_id=11125789


in reply to why avoid & on function call

In Perl 4 the &sigil was mandatory, Perl 5 changed this.

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

Updates

°) other use case are:

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
    defined &func, exists &func, and goto &func (distinct from the troublesome goto LABEL) are some other examples when you would use the ampersand to refer to a named function. -Dan
      > are some other examples when you would use the ampersand to refer to a named function.

      goto was already mentioned :)

      > > ˛) some built-ins require & with named subs as arguments, like goto, map , grep , sort

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery