in reply to Count from 1 after a user entered number

First off, you should start your code with:
use warnings; use strict;
and possibly, if you want more explanations,
use diagnostics;
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.

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
    Probably appears like "homework" but it is a part of a larger script that I am piecing together. Thanks for your help.