in reply to Count from 1 after a user entered number
and possibly, if you want more explanations,use warnings; use strict;
That would have caught at least a couple of errors in your code. Since this seems a LOT like homework, I'm only giving hints.use diagnostics;
o (the letter) isn't 0 (the number). use a better editor/font if you can't see the difference.
You've got blocks { .. } where you don't need any.
foreach $input isn't valid, and since $input isn't a list you're not gaining anything by looping over it.
You probably want something like: foreach (1 .. $end) { ... } instead.
last; unconditionally ends the loop. but there isn't any useful loop here.
you're not print()ing anything.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Count from 1 after a user entered number
by trenchwar (Beadle) on Mar 22, 2008 at 23:26 UTC | |
by Joost (Canon) on Mar 22, 2008 at 23:37 UTC |