in reply to Is there an easier way?

A regex would probably be preferred:
$date =~ m|(\d{1,2})/(\d{1,2})/(\d{4})|; ($month,$day,$year) = ($1,$2,$3);
This code is untested.

Update: Doh! A very stupid error was made on my part. See Merlyn's helpful comment below.

When's the last time you used duct tape on a duct? --Larry Wall

Replies are listed 'Best First'.
Re: Re: Is there an easier way?
by merlyn (Sage) on May 01, 2001 at 03:46 UTC
    $date =~ m|(\d{1,2})/(\d{1,2})/(\d{4})|; ($month,$day,$year) = ($1,$2,$3);
    Augh. Use of $1 there without checking for the success of the match. Good way to uncover a bug or a security hole. Never. Don't.

    At a bare minimum, add "or die" to the first line. Then I'll be happy.

    -- Randal L. Schwartz, Perl hacker