in reply to how to program my program to add random numbers?

Can you be a little more clear about what the teacher was unhappy about?

You don't have to have the $z = $x +|-|*|/ $y;. You can do the calculation in the print statement ({print "$x + $y = " . $x + $y . "\n";) and then you can remove the inefficient 3 checks (if the user entered "Add" it will still check to see if he entered sub,mult,div). Those should be elsifs.

This is all speculation as I can't read your teacher's mind. Hope this helps a little.