Why? What's more readable about
foreach my $foo (@bar) { do_something($foo); }
than do_something($_) foreach @bar; ? All I see is twice as much to type and read with absolutely no difference to the clarity. Especially when you nest a few of those and it ends up something like
for $blah (@blah) { # ... # ... # ... if($whatever) { last; } while($foo) { if(@bar) { # ... while($baz) { # ... # ... # ... } if($whatever) { next; } elsif($snafu) { last; } else { # ... } # ... # ... } # ... } } # ... # ... }
It's atrocious. Please use a few last if ... and spare me the effort of having to eyeparse 15 levels of indentation.

Makeshifts last the longest.


In reply to Re^5: The Cost of Nested Referencing by Aristotle
in thread The Cost of Nested Referencing by shotgunefx

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":