newby2perl has asked for the wisdom of the Perl Monks concerning the following question:
want to check a field for content...it should contain only numeric values like 12345.67 or 0 or 0.00 or -123.78 here is code I am struggling with
while ( $amount2 =~ / / ){ $amount2 =~ s/ //g; } if ( ($amount2) =~ /_(\d+)\./) { print BAD_OUTPUT "Amount field cannot contain alpha characters :"; + print BAD_OUTPUT $_,"\n"; next; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: only want numerics in field
by davido (Cardinal) on Apr 21, 2014 at 16:37 UTC | |
|
Re: only want numerics in field
by Limbic~Region (Chancellor) on Apr 21, 2014 at 15:44 UTC | |
|
Re: only want numerics in field
by bigj (Monk) on Apr 21, 2014 at 15:52 UTC | |
by Limbic~Region (Chancellor) on Apr 21, 2014 at 16:09 UTC | |
by bigj (Monk) on Apr 21, 2014 at 16:37 UTC | |
by newby2perl (Initiate) on Apr 21, 2014 at 16:40 UTC | |
by newby2perl (Initiate) on Apr 21, 2014 at 16:48 UTC | |
|
Re: only want numerics in field
by AnomalousMonk (Archbishop) on Apr 21, 2014 at 19:12 UTC |