HiFoo has asked for the wisdom of the Perl Monks concerning the following question:
Is it possible to determine if a scalar variable is an integer or a string?
In a shell script I am porting:
expr $VAR + 1; if [ $? -ne 0 ]; then do stuff... fi
was used to check to see if the value of the variable was an integer.
Is there a similar way to do this in Perl?
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Integer Type Checking
by insensate (Hermit) on Jul 19, 2002 at 17:37 UTC | |
|
Re: Integer Type Checking
by mkmcconn (Chaplain) on Jul 19, 2002 at 18:38 UTC | |
|
Re: Integer Type Checking
by Nightblade (Beadle) on Jul 19, 2002 at 17:23 UTC | |
|
Re: Integer Type Checking
by simeon2000 (Monk) on Jul 19, 2002 at 17:26 UTC |