in reply to Re^2: Create reference to sorted anonymous array
in thread Create reference to sorted anonymous array
is just fine !!foreach my $line (@$array_ref) { print $line; }
I write and lot of C code (and also ASM). I can tell you that the very, very most common error in programming is the "off by one" error. The foreach() syntax avoids that possibility. There are a lot of programs out there that sometimes break in mysterious ways due to memory allocation errors and other issues related to the "off by one" problem. the foreach() syntax avoids this problem.
You early instruction will serve you well. There is just a different way to do it in Perl than in C.
|
|---|