| Subject: | Re: Regular expression: How to determine wether entry is a number? |
|---|---|
| From: | jwkrahn@xxxxxxx (John W. Krahn) |
| Date: | Tue, 29 Jul 2008 10:03:47 -0700 |
| Newsgroups: | perl.beginners |
Jan-Henrik wrote: Dear Group, I'm new to Perl and I have a simple question: I ask for the entry of a number vie <STDIN>: ---------------------------------------- #!/usr/bin/perl -w use strict; my $foo; print "Enter number: "; $foo = <STDIN>; comp($foo); ---------------------------------------- Now I would like to check wether the user really entered a number and not letters. What would a check like that look like? perldoc -q "How do I determine whether a scalar is a number" John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Regular expression: How to determine wether entry is a number?, Aruna Goke |
|---|---|
| Next by Date: | Re: Regular expression: How to determine wether entry is a number?, Paul Lalli |
| Previous by Thread: | Re: Regular expression: How to determine wether entry is a number?, Paul Lalli |
| Next by Thread: | Question about lwp-rget, Bdy |
| Indexes: | [Date] [Thread] [Top] [All Lists] |