On Wednesday, November 20, 2002, at 03:43  PM, Duane Bronson wrote:

Anyway, to put your mind at ease, use the for(;;) syntax.  The big
difference is that you have to pull $_ out of the array yourself.

for (my $counter=0;$counter<=$#array;$counter++)
{
    $_=$array[$counter];
    #do something

    print $another_array[$counter];
}
Or don't even bother with $#array since "$n <= @array" forces scalar context to the array, which causes it to interpolate to the number of elements.

Terser, quicker, more seductive. Such is the way of the dark side of Perl programming. (Even if by only one char.)



Erik





--
Erik Price (zombies roam)

email: [EMAIL PROTECTED]
jabber: [EMAIL PROTECTED]

_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to