On Wed, Dec 01, 2004 at 02:00:49PM +0100, Ing. Branislav Gerzo wrote:

> Mat Harris [MH], on Wednesday, December 1, 2004 at 12:19 (+0000)
> contributed this to our collective wisdom:
> 
> >> Is there any special function for that job?
> 
> MH> personally I would use a rexex:
> MH> if ($myunknownvalue =~ m/^\d*$/)
> 
> personally I would change this regex to:
> if ($myunknownvalue =~ m/^\d+$/)
> because regex given matches also empty set ('')

personally I would use Scalar::Util::looks_like_number() which calls the
function that perl uses internally

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to