Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

RE: Re: Minor querry!!

by mrmick (Curate)
on Jun 27, 2000 at 21:06 UTC ( [id://20036]=note: print w/replies, xml ) Need Help??


in reply to Re: Minor querry!!
in thread Minor querry!!

Another variation on Shendal's solution could be to allow for decimals. I hardly ever work with whole numbers (not through choice, but because of the data we are responsible for here).
my $number = <STDIN>; chomp $number; if ($number !~ /^\d+\.?\d*$/) { print "$number is not a number.\n"; exit 1; } else { print "$number is a number!\n"; }
I hope this proves useful to someone. mrmick

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://20036]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 03:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found