in reply to shift @ARGV not working
I think the issue you are a having is you didn't shift prior to setting $argument.#!/usr/bin/perl -w use strict; foreach my $i(0..$#ARGV){ printf "\$ARGV[%d] = \"%s\"\n",$i,$ARGV[$i]; } while(my $arg=shift @ARGV){ printf "%s\n",$arg; } # # -------------- 8< snip! 8<------------- $ ./shifty.pl a b c d e f g $ARGV[0] = "a" $ARGV[1] = "b" $ARGV[2] = "c" $ARGV[3] = "d" $ARGV[4] = "e" $ARGV[5] = "f" $ARGV[6] = "g" a b c d e f g
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: shift @ARGV not working
by Anonymous Monk on May 09, 2013 at 19:15 UTC | |
by Anonymous Monk on Apr 04, 2024 at 13:13 UTC |