$_ improves legibility.
Compare:
while ($line = <>) {
next if $line =~ /^#/;
$line =~ s/left/right/g;
$line =~ tr/A-Z/a-z/;
print "$ARGV:";
print $line;
}
with:
while ( <> ) {
next if /^#/;
s/left/right/g;
tr/A-Z/a-z/;
print "$ARGV:";
print;
}
Forward to Use foreach() Loops
Back to Use Hashes of Records, not Parallel Arrays
Up to index
Copyright © 1998, Tom Christiansen
All rights reserved.