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

Re: only numeric data

by arnaud99 (Beadle)
on Jun 28, 2013 at 07:18 UTC ( #1041162=note: print w/replies, xml ) Need Help??


in reply to only numeric data

Hi

Would using looks_like_number() help?

use Modern::Perl; use Scalar::Util qw /looks_like_number/; my @data=("conteent" , , , ,25.36,36.36,85.1,'xx','.....'); for (@data) { say $_ if looks_like_number($_); }

Output

~/perl/ex/perlmonks: perl check_numbers.pl 25.36 36.36 85.1

I hope this helps

Arnaud

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041162]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2016-12-03 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (56 votes). Check out past polls.