in reply to Cant use array with numbers??

There are a couple of bugs in the for loop.

You probably want something like;

for($i=0; $i < @Array; $i++) { ... }
The for loop can be used in Perl the same way as you would in C. Of course the for loop in Perl can be used in the other ways too.

Replies are listed 'Best First'.
Re^2: Cant use array with numbers??
by ikegami (Patriarch) on Sep 18, 2007 at 12:59 UTC

    We have been encouraging the following syntax:

    for my $i (0..$#Array) { ... }

    It's just as efficient, and much more readable.

      That is fair enough. I wasn't trying to recommend a better way, only answer the question asked.