Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 exploiting the Monastery: (9)
As of 2015-07-31 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls