in reply to validate if output of command is numeric or not
sub check { my $value=""; if ($_[0]=~ m/\d+/) { $value=$_[0]; print qq~$_[0] is numeric\n~; } el +se { $value=""; print qq~$_[0] is not numeric\n~; } return($value); } my $in=0815; my $out=&check($in); # have phun!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: validate if output of command is numeric or not
by worik (Sexton) on Feb 28, 2016 at 22:42 UTC | |
by Anonymous Monk on Feb 29, 2016 at 19:01 UTC |