- or download this
for (1,2) {
while (<STDIN>) {
}
}
- or download this
for ("foo\n", "bar\n") {
chomp;
print;
}
- or download this
for my $str ("foo\n", "bar\n") {
chomp $str;
print $str;
}
- or download this
@bad = map {$_++} (1,2);
@bad = grep {$_++} (1,2);
- or download this
sub bad {
$_[0]++;
}
bad(1);
- or download this
my @good = (1,2);
@good = sort {$a++ <=> $b} @good;
- or download this
@bad = sort {$a++ <=> $b} (1,2);
- or download this
my @bad;
$bad[0] = [1];
$bad[2] = [2];
@bad = sort {$a->[0] <=> $b->[0]} @bad;