Title: Re: Test if string is a number?
Chris Wagner wrote, on Thu 6/30/2005 08:48

: Wow there's been a lot of heavy duty code proposed to do something so
: simple.  The answer is in how Perl converts between the two.
:
: print "is a number" if $var eq $var + 0;
: print "not a number" if $var ne $var + 0;

Except if $var is, say, '0.00'. Then $var + 0 is '0', and won't eq $var.
 
Joe

==============================================================
          Joseph P. Discenza, Sr. Programmer/Analyst
               mailto:[EMAIL PROTECTED]
 
          Carleton Inc.   http://www.carletoninc.com
          574.243.6040 ext. 300    fax: 574.243.6060
 
Providing Financial Solutions and Compliance for over 30 Years

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to