How about 1.02e12?

If you want to know if it looks like a number to perl, this might be handy:

  use Scalar::Util qw(looks_like_number);
  print "Number" if looks_like_number($number);

Scalar::Util is part of the standard library in 5.8.x, I believe.

-- 
Mark Thomas 
Internet Systems Architect
_______________________________________
BAE SYSTEMS Information Technology 
2525 Network Place
Herndon, VA  20171  USA 


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Paul Rogers
> Sent: Wednesday, November 17, 2004 1:29 PM
> To: [EMAIL PROTECTED]
> Subject: Re: numeric vs string scalars...difference?
> 
> 
> Hi Paul,
> 
> You are absolutely right.  However, the real problem was that 
> I had to 
> dynamically determine whether to use == or eq...thus I needed 
> a way of 
> reliably determining whether a variable was numeric or 
> string. That's where 
> the regex came into play.
> 
> Thanks,
> Paul ---
> 
> ----- Original Message ----- 
> From: "Paul Sobey" <[EMAIL PROTECTED]>
> To: "Paul Rogers" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 17, 2004 4:16 AM
> Subject: RE: numeric vs string scalars...difference?
> 
> 
> Hi,
> 
> Isn't eq a string comparison? Try using == instead:
> 
> print "String compares\n" if "45" eq "45.0"; # Fails
> print "Number compares\n" if "45" == "45.0"; # Passes
> 
> Cheers,
> Paul
> 
> 
> 
> _______________________________________________
> Perl-Win32-Users mailing list 
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to