On Fri, Feb 01, 2002 at 01:39:05PM +1100, [EMAIL PROTECTED] wrote:
> Well, this won't be the "most" efficient way, but it should be
> reasonably efficient, and will work with dates that include varying
> degrees of pre-existing zero-padding.
<snip>
>     $date =~ s%^(\d)(?=/)%0$1%;
>     $date =~ s%(?<=^\d\d/)(\d)(?=/)%0$1%;

Folks, I'm clawing my eyes out here.  Stop hitting the regex crack pipe!

$date = sprintf "%02d/%02d/%d", split '/', $date;


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
no paste enema
lycos is taught about it
my ass is sealed
        -- Schwern

Reply via email to