Note also that a statement like
$_ = shift;
clobbers the contents of the $_ default scalar. Because $_ is global, this may cause Problems.
If you must use $_ in this way, I would recommend the use of local within a statement or subroutine block:
local $_ = shift;
or
local ($_) = @_;
(but this still affects the value of $_ as seen by any function called within that block after the point of local-ization!)
In reply to Re: style guidance
by AnomalousMonk
in thread style guidance
by 7stud
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |