Change the while (@ARGV) {$arg = shift @ARGV; to for $arg (@ARGV) {.
Note though that $arg is aliased to each of the elements of @ARGV in turn so if you change the contents of $arg inside the for loop you will change the contents of @ARGV.
In reply to Re: getting args without clobbering @ARGV
by GrandFather
in thread getting args without clobbering @ARGV
by bfdi533
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |