A
AShrestha
Hi,
I am checking to see if an $a is valid number (could be 12 12. 12.0
..12). The logic I used was to check for only digits with no or one \.
character. I am not able to get the right answer with this? Help
appreciated
regards,
AS
#!/usr/bin/perl
$a= "11.2.";
if ($a != /(\D+ & [^\.?])/) {
print "$a it VALID\n";
} else {
print "INVALID number\n";
}
I am checking to see if an $a is valid number (could be 12 12. 12.0
..12). The logic I used was to check for only digits with no or one \.
character. I am not able to get the right answer with this? Help
appreciated
regards,
AS
#!/usr/bin/perl
$a= "11.2.";
if ($a != /(\D+ & [^\.?])/) {
print "$a it VALID\n";
} else {
print "INVALID number\n";
}