$c = $a - $b; #### ... code ... sub subtraction{ chomp(@_ = split(" ", )); # user enters values on one line foreach(@_) { $result -= $_; # I guess I am using the WRONG operator } print "Result: $result\n\n"; ... rest of subroutine code ... }