in reply to Advice on First Perl Script

hi there,

Well I'll start the responses off with the usual...

use strict; use warnings;

That should give you some interesting feedback to investigate when a script doesn't work ;-)
You could also use chomp on $num and $y to remove carriage returns etc. ie

chomp($num = <STDIN>);

I'm sure there are some more experienced monks who will contribute further.
Also check out some of the tutorials - they're very good. (So is the O'reilly book - Learning Perl)