&date_calc; and &get_dirs; is Perl4-style. Avoid the ampersand, it usually does not do what you intent to do.
is not Perl4, is perfectly valid Perl5, and is reffered by official docs as optional in modern perl
It is still not optional in three cases:
# while naming a sub like in: defined &my_sub_name; # doing indirect sub call (but $subref->() is another valid option) &$subref(); # making a reference to a sub $coderef = \&handler;
..it usually does not do what you intent to do.just means that &get_dirs receive the current @_ even if no args are specified. The programmer must be aware of this and the feature can be also used in a profitable way.
The example in perlsub is exahustive:
&foo(1,2,3); # pass three arguments foo(1,2,3); # the same foo(); # pass a null list &foo(); # the same &foo; # foo() get current args, like foo(@_) !! foo; # like foo() IFF sub foo predeclared, else "foo"
L*
In reply to Re^2: Merge log files causing Out of Memory (just a note on ampersand)
by Discipulus
in thread Merge log files causing Out of Memory
by malokam
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |