Date: 07 Jul 2001 02:16:50 GMT From: "James E Keenan" Subject: Re: Why for loop not working?? Message-Id: <9i5rei$374@dispatch.concentric.net> "Carlos C. Gonzalez" wrote in message news:MPG.15b0181c6a03fe98968b@news.edmonton.telusplanet.net... > Hi everyone, > > Why does the following code not work?? > > use strict; > my $s = "carlos,carlos\@somedomain.com,07-05-2001"; > my @temp = split(/,/,$s); > for (my $i=0; @temp; $i++) > { > print $temp[$i]."\n"; > } > Your "for" loop is missing the test condition from the 2nd element in the parens. It should be either: for (my $i=0; $i <= $#temp; $i++) or for (my $i=0; $i < scalar(@temp); $i++) James E. Keenan jkeen@concentric.net Brooklyn, NY