[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] printf("%02d", "2007")




On Apr 24, 2007, at 3:42 PM, Jay Hannah wrote:

unless ($a[0] =~ /^\w\w\w \d\d \d\d\d\d/) {
   die "Unrecognized date format from MS-SQL: '$a[0]'";
}
@b=split ' ',$a[0];

Funny that they match a pattern, and then do the split.  Better to do:

unless ( @b = ($a[0] =~ /^(\w{3}) (\d{2}) (\d{4})/ ) {
	die...
}

Then @b is populated.

--
Andy Lester => andy@petdance.com => www.petdance.com => AIM:petdance