You will rarely need C-style loops
for ($i = 0; $i <= $#sortedNames; $i++) {
If you need a counting loop, use the much more readable (and just as efficient)
for my $i (0..$#sortedNames) {
Or when iterating over a list or array, you can use
for my $name (@sortedNames) {
Why use reverse to prepend a string?
$toOutput = reverse $temp[0]; $toOutput .= $x; $output = reverse $toOutput;
is the same as
$output = $x . $temp[0];
In reply to Re: Perl 'grammar'
by ikegami
in thread Perl 'grammar'
by gortok
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |