I'll not comment on the errors in the algorithm - after all, it's your homework and not mine. So, here are some Perl tips:
Note there are no parentheses around $limit in the declaration. With the parentheses, you enter "list context" - which means you'll read line after line from STDIN, until you hit Ctrl-D for "end of file".print "Please enter a number: \n"; my $limit= <STDIN>; chomp $limit;
In reply to Re: New Perl user - help with my homework
by haj
in thread New Perl user - help with my homework
by Eardrum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |