- or download this
my %total_for;
- or download this
my $operator = 'Nicole';
$total_for{$operator} = 123; # total for Nicole is 123
$total_for{$operator} += 45; # increase Nicole's total by 45.
- or download this
foreach my $operator ( sort keys %total_for ) {
print "Total for $operator: $total_for{$operator}\n";
}
- or download this
open(LOG, $file) or die "Can't read '$file': $!";
- or download this
while (<LOG>) {
@tmpwords = split;
# etc.
}
- or download this
foreach my $blah ( @array ) {
# use $blah instead of $_ for things
}
- or download this
use strict;
use warnings;
...
foreach my $operator ( sort keys %total_for ) {
print "Total for '$operator': $total_for{$operator}\n";
}