Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

muba

by muba (Priest)
on Mar 03, 2004 at 09:25 UTC ( #333489=user: print w/ replies, xml ) Need Help??

My nodes that made it to the front page

 

Ways to find out if $scalar is numeric

tye and me having a little fun in the chatterbox.

[muba]: my $is_string = ($scalar ^ $scalar) eq ("$scalar" ^ "$scalar");
[tye]: my $isNumber = $scalar ^ '00' eq $scalar;
[tye]: my $isNumber = do { my $warn= 0; local $SIG{__WARN__}= sub { $warn= 1 }; use warnings; $scalar^=''; $warn };
tye]: my $isNumber = ( $scalar ^ "$scalar" ) =~ /\d/;

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-10-21 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls