in reply to atm deposit problem

Another problem in your code: The deposit function returns the last expression evaluated: and it is print, which returns 1 when succesfull. Do not print anything in the sub, just return $bal.