Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: non numeric data

by Happy-the-monk (Abbot)
on Jun 24, 2013 at 13:37 UTC ( #1040439=note: print w/ replies, xml ) Need Help??


in reply to non numeric data

true only when it has a non numeric data

I'd personally try this first:

if ($array_H[$i] =~ m/\D/ ) { block; }

where \D matches any one character that isn't 0..9.

Now empty strings and all-0-9-stuff pass, everything else enters the block.

Cheers, Sören

(hooked on the Perl Programming language)


Comment on Re: non numeric data
Download Code
Re^2: non numeric data
by tobyink (Abbot) on Jun 24, 2013 at 14:10 UTC

    /\D/ matches 1.1, -4 and 1000000000000000 (depending on your CPU architecture).

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

      /\D/ matches 1.1, -4 and 1000000000000000 (depending on your CPU architecture).

      Good point, tobyink!

      Cheers, Sören

      (hooked on the Perl Programming language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2015-07-03 00:10 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 (47 votes), past polls