Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: non numeric data

by torres09 (Acolyte)
on Jun 24, 2013 at 13:00 UTC ( #1040429=note: print w/ replies, xml ) Need Help??


in reply to Re: non numeric data
in thread non numeric data

ya i figured that out , there is a possibility that numbers having - sign are not being blocked so I modified by code . please tell if it is fine or not

if (($array_H[$i] !~ /^[0-9]+$/) &&($array_H[$i] !~ /^-+$/))

I am new to perl so please pardon me for obvious mistakes


Comment on Re^2: non numeric data
Download Code
Re^3: non numeric data
by hdb (Prior) on Jun 24, 2013 at 13:06 UTC
Re^3: non numeric data
by hdb (Prior) on Jun 24, 2013 at 13:15 UTC
Re^3: non numeric data
by BillKSmith (Deacon) on Jun 24, 2013 at 14:59 UTC
    Depending on the source of your data, it may have whitespace (especially a newline) at the end.
    Bill

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2015-07-07 14:42 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 (89 votes), past polls