in reply to (One Last)Re: Range Operators Question
in thread Range Operators Question

Ok, you got the answer to your problem. I want to point out something else in your code - I'm not sure you are aware of that:

@arr = (1 .. 20); foreach $i ( 0 .. $#arr ) { # do something }
You are creating an array @arr and the only thing you are using it for is to get the index of its last element ($#arr = 19). So your code could be written as:
foreach $i ( 0 .. 19 ) { # do something }
If you want $i to go from 1 to 20 just say so:
foreach $i (1 .. 20)) { # do something }
And you can also use the array for that - although it is not reasonable to create the array just for that:
foreach $i (@arr)) { # do something }

-- Hofmator