in reply to Re: How to reorder a text file
in thread How to reorder a text file

In the

foreach my $n (0 .. @normal){ if ($n%2){ push @reverse, $normal[$n].$normal[$n+1]; } }
loop, aren't you indexing beyond the end of the  @normal array? Won't this produce "Use of uninitialized value..." warnings if warnings are enabled? Shouldn't the loop range be  for my $n (0 .. $#normal-1) { ... } instead?

(And BTW: Aren't you losing an opportunity to avoid using a foreach-loop by not re-writing the loop as a map | void-context map statement? :)


Give a man a fish:  <%-{-{-{-<