In addition to excellent points by Corion, here's a few more:
Note there's no checking of potentially unsafe, externally entered data nor does it allow for a variable range of lines.my @keyed_data = map { print qq{Number $_: }; scalar <> } (1 .. 5);
Note the output is completely unformatted except for a reliance on control characters embedded in the data - which is not good.print sort { $a <=> $b } @keyed_data;
might have been more easily spotted if written like:if ($a > $b {$bin = $b; $b = $a; $a = $bin; print "nThis is line 1 $a $b \n";}
if ($a > $b { $bin = $b; $b = $a; $a = $bin; print "nThis is line 1 $a $b \n"; }
-- Ken
In reply to Re: Check this code please?
by kcott
in thread Check this code please?
by rse2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |