----- Original Message ----- 
From: "Paul Rogers" <[EMAIL PROTECTED]>

>
>  # NOTE:  at some point, may wish to substitute with...
>  # use Scalar::Util qw(looks_like_number);
>  # print "Number" if looks_like_number($number);
>

 use warnings;
 use Scalar::Util qw(looks_like_number);

 $input = "1e7";

 if( $input =~ /^\-?(\d+\.?\d*|\.\d+)$/ ) {
  print 1, "\n";
 } else {
  print 0, "\n";
 }

 if(looks_like_number($input)) {print 1, "\n"}
 else {print 0, "\n"}
__END__

outputs:
0
1

Sorry ... but you should have known that there'd be some smartarse just
waiting to poke a hole in your code :-)

Cheers,
Rob

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

Reply via email to