in reply to Usage of Shift function in PERL
You seem to be expecting it'll put its return value into $_ when in void context, but it doesn't. I can't even think of any built-in function that does that, for the moment, though split clobbers up @_ in scalar and void context — and that usage is deprecated. Using $_ as a default argument: yes; as a return value: no.
Try:
$_ = shift @ARGV; print; # This does use $_ by default
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Usage of Shift function in PERL
by Abigail-II (Bishop) on May 03, 2004 at 11:45 UTC |