http://www.perlmonks.org?node_id=589199


in reply to For Loops and Reversing output

brusimm,
So you want to reverse without using reverse:
my $idx = $#array; while ($idx--) { print "$array[$idx]\n"; }
Oh, you really want to go forwards but have the output appear backwards?
my $output = ''; for my $elem (@array) { $output = "$elem\n" . $output; } $output .= "\n"; print $output;

Cheers - L~R