Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
P is for Practical
 
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


Comment on Re: only numeric data
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2014-04-18 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (466 votes), past polls