in reply to Can someone help me make this script more efficient

or you can do it something like this
use strict; use warnings; my @pence=qw(5 10 20 50); my @notes=qw(5 10 20 50); my ($sum1, $sum2); foreach my $c (@pence){ print "How many $c pence pieces do you have? "; my $num=<STDIN>; chomp $num; my $res = ($c * $num)/100; $sum1 += $res; } foreach my $n (@notes){ print "How many &#321;$n notes do you have? "; my $num=<STDIN>; chomp $num; my $res = ($n * $num); $sum2 += $res; } my $final =$sum1+$sum2; print "You are ritch, you have $final coins!!!!!";
it is a bit longer but intuitive.