in reply to for ( ; ; ) vs for ( .. )

Actually, why not:
for (@ARGV) { .. }
-- Joost downtime n. The period during which a system is error-free and immune from user input.

Replies are listed 'Best First'.
Re2: for ( ; ; ) vs for ( .. )
by Albannach (Monsignor) on May 23, 2002 at 17:18 UTC
    Perhaps because its just not the same thing? Your's sets $_ to the elements of the array, while Popcorn Dave's sets $_ to one more than the indices of the array (which probably isn't the desired result). As broquaint suggests, I tend to use the for(0..$#ARGV) version if I happen to need the indices.

    --
    I'd like to be able to assign to an luser

Re: Re: for ( ; ; ) vs for ( .. )
by Popcorn Dave (Abbot) on May 23, 2002 at 18:01 UTC
    In the original code, the first argument was an option, the rest were files, so that wouldn't have worked in this particular instance.

    Some people fall from grace. I prefer a running start...