Joe
Bob
Sally
Bob
Fred
####
5
3
7
1
1
####
open(KEYS, "keys.txt") or die "error: $!";
open(VALS, "values.txt") or die "error: $!";
my ($key,$value);
my (%tips_by_name, %av_by_name, %max_by_name, %min_by_name);
while ($key=) {
$value=;
chomp($key);
chomp($value);
$tips_by_name{$key} += $value;
# code to do average, min, max here..
# I'm not asking about that part, my question is
# more about the way of reading files
}
close(VALS);
close(KEYS);
# code to print out the results here... again
# not part of my question at the moment.
####
paste keys.txt values.txt > combined.txt