Just for starters,
To see the errors, run the program from a command prompt:
Start | Run | cmd
From the command prompt:
perl script.pl
You should really put
use strict;
use warnings;
at the top of your program. This will save you lots of grief, even though you'll have to start declaring your variables (using my).
You still have the for wrong. I suggest you re-read the documentation.
for ($i==$x; $i==$y; $i++)
should be
for (my $i=$x; $i==$y; $i++)
(my added as a bonus)
Or if you want to include $y,
for (my $i=$x; $i<$y; $i++)
But why not use the easier to read/understand/write
for my $i ($x..$y-1)
Or if you want to include $y,
for my $i ($x..$y)
Similarly,
for ($m=3; $m=$n; $m+=2)
should probably be
for (my $m=3; $m<$n; $m+=2)
By the way, you're assuming (i.e you don't validate) that the user supplies integers for $x and $y, and that the number he supplied for $x is smaller than or equal to $y.
In reply to Re: Debugging?
by ikegami
in thread Debugging?
by Andrew_Levenson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |