#!/usr/local/bin/perl use strict; use warnings; my %sales = ("tanaka"=>150, "suzuki"=>300, "ohira"=>200); my $sum = 0; foreach my $key (keys(%sales)) { print "sales for $key is $sales{$key}\n"; #処理を追加 } print "Total sales: $sum\n";