Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!wuarchive!zaphod.mps.ohio-state.edu!usc!apple!rutgers!mcnc!uvaarpa!mmdf From: marc@athena.mit.edu Newsgroups: comp.lang.perl Subject: Bug? Message-ID: <1990Oct1.045155.8848@uvaarpa.Virginia.EDU> Date: 1 Oct 90 04:51:55 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: marc@mit.edu Organization: The Internet Lines: 30 The following perl program: #!/mit/watchmaker/@sys/perl $" = ","; print "$[-$#ARGV:$ARGV[0]:@ARGV\n"; for ($i=$[; $i<=$#ARGV; $arg = $ARGV[$i++]) { print "\$i=$i; \$arg=$arg\n"; } When executed as follows, seems to yield incorrect output: <81> steve-dallas:~> perl/ftest.pl a b c 0-2:a:a,b,c $i=0; $arg= $i=1; $arg=a $i=2; $arg=b By the time that $i gets printed, it should have been incremented by 1 already, so I should see 0-2:a:a,b,c $i=1; $arg=a $i=2; $arg=b $i=3; $arg=c as output (I think). Is there anything painfully obvious that I'm doing wrong? btw, I'm using a for loop instead of forach for a specific reason, so that isn't an option. Marc