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

Andy Lester andy at petdance.com
Tue Apr 24 17:04:32 PDT 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 at petdance.com => www.petdance.com => AIM:petdance






More information about the Omaha-pm mailing list