gitarwmn has asked for the wisdom of the Perl Monks concerning the following question:
my %emails = (gwbush => "\$19.95", billc => "\$19.95", igor => "\$19.95", jdoe => "\$25.00", maryp => "\$35.00", bgates => "\$50.00", joelg => "\$1.50"); my $ename; my $weeks; print "Enter Email address.\n"; print "\nPress 'q' to quit\n"; while (){ print "\nEmail?\n"; chomp ($ename = <STDIN>); if ($ename eq 'q'){ print "Quiting program"; last; } print "Weeks worked? \n"; chomp ($weeks = <STDIN>); print "\n$ename\t$emails{$ename}\n"; $emails{$ename} *= $weeks; print "We owe $ename\t$emails{$ename}\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multiply hash values
by fglock (Vicar) on Oct 27, 2004 at 20:55 UTC | |
|
Re: multiply hash values
by borisz (Canon) on Oct 27, 2004 at 20:56 UTC | |
|
Re: multiply hash values
by Fletch (Bishop) on Oct 27, 2004 at 22:56 UTC | |
by shenme (Priest) on Oct 27, 2004 at 23:34 UTC | |
by chromatic (Archbishop) on Oct 28, 2004 at 00:09 UTC | |
by tilly (Archbishop) on Oct 28, 2004 at 05:39 UTC |