in reply to subroutine..help

You have already got the answer:
You should have thought: How you are getting the values inside the subroutine which is passed to the subroutine.
What you have :my($a,$b);
What you Should have: my($a,$b) = @_;