my @data = shift; my $loop_count = 0; while (@data) { $data[$loop_count] =~ m{s/^\s*//}xms;#line 212 $data[$loop_count] =~ m{s/\s*$//}xms;#line 213 $loop_count++; } #### foreach $element (@array) { do_stuff_to($element); } #### for $index (0..$#array) { # $#array is the last index of @array do_stuff_to($array[$index]); do_stuff_to($other_array[$index]); };