in reply to Pattern matching and setting the match to a variable
isn't as clear as (and no more efficient than)for (my $i=0; $i<=$#my_data;$i++)
And more specifically,for my $i (0 .. $#my_data)
can simply be written asfor ($i=0; $i<=$#my_data;$i++) {print $my_data[$i], "\n"; }
for (@my_data) {print $_, "\n"; }
|
---|