so shift physically removes the entry in @ARGV? this is interesting and i did not realize that
Indeed it does:
$ cat shifter.pl #!/usr/bin/env perl use strict; use warnings; do { print "ARGV is @ARGV\n"; print "Shifting " . shift . " off ...\n"; } until $#ARGV < 0; $ ./shifter.pl x y z ARGV is x y z Shifting x off ... ARGV is y z Shifting y off ... ARGV is z Shifting z off ... $
See perldoc -f shift for more.
In reply to Re^8: Sort alphabetically from file
by hippo
in thread Sort alphabetically from file
by edujs7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |