I am quite new to programming and Perl, so please bear
with me.

I have a requirement to check the format of a field
before a record can be saved. The format of the field
needs to be double digit value separated by a .
(period) like "00.00.00". This I managed to do using
the following:

use strict;
use warnings;

my $field;

print "This program will verify field value.\n";

print "Enter field value:  "; 

$field = <STDIN>;

chomp ($field);

if ( $field =~ /^[0-9]{2}\.[0-9]{2}\.[0-9]{2}$/ )

{ 
print "Value is OK";
}
else
{
print "Value is Wrong. Please enter a double digit
value like 00.00.00";
}
###########

However, the requirement has changed in that we while
we want to allow the "00.00.00" format we do not a 0
(zero) to be a leading value. 

How can this be accomplished? 

Please advise.

Regards.

Amad


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to