Melderon has asked for the wisdom of the Perl Monks concerning the following question:
The first:
if ($numind!=int) { print "**This is an invalid entry!", "\n", "Please try again.**\n" +; goto START; }
The second:
if ($numind!=int(1..10000)) { print "**This is an invalid entry!", "\n", "Please try again.**\n" +; goto START; }
The first error states that I have an uninitialized value, which makes sense but the second one, instead of limiting a decimal, limits all input, integer or not, and prints the "Invalid entry" output.
Any help is appreciated,
Melderon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using int and the range function
by toolic (Bishop) on Jan 15, 2015 at 21:40 UTC | |
|
Re: using int and the range function
by AnomalousMonk (Archbishop) on Jan 15, 2015 at 21:48 UTC | |
|
Re: using int and the range function
by Laurent_R (Canon) on Jan 15, 2015 at 22:42 UTC | |
by soonix (Chancellor) on Jan 16, 2015 at 07:42 UTC | |
by Laurent_R (Canon) on Jan 16, 2015 at 07:49 UTC | |
|
Re: using int and the range function
by pme (Monsignor) on Jan 15, 2015 at 21:32 UTC | |
by AnomalousMonk (Archbishop) on Jan 15, 2015 at 21:43 UTC | |
by RonW (Parson) on Jan 16, 2015 at 01:17 UTC | |
by pme (Monsignor) on Jan 16, 2015 at 07:57 UTC | |
|
Re: using int and the range function
by Anonymous Monk on Jan 15, 2015 at 22:19 UTC |