in reply to Advice on First Perl Script

You should get into the habit of using lexical variables instead of package variables, so:
$num = <STDIN>;
Would become:
my $num = <STDIN>;
While perl supports C style for loops it is usually preferred to use perl's for loops, so:
for ( $x = 1; $x <= $y; $x++ )
Would become:
for my $x ( 1 .. $y )