in reply to output question

Your input includes the "enter" from the keyboard. You need to chomp your input. For example:

print "Enter your first number:\n "; $number=<STDIN>;

Needs to become something like:

print "Enter your first number:\n "; $number=<STDIN>; chomp $number;