in reply to date format

sub convert { if ($_[0] eq "7/Jun/2010:23:02:10 ") { return "2010061802:00:14"; } }

Replies are listed 'Best First'.
Re^2: date format
by Anonymous Monk on Jun 21, 2010 at 08:34 UTC
    Almut's solution is good, but not scalable. If you use a hash, you can easily add more dates in the future.

    my %DATES = ( "7/Jun/2010:23:02:10 " => "2010061802:00:14", "7/Zog/2100:12:63:13 " => "2010060608:39:11", "my birthday" => "1974012618:12:10", #simply add all the other dates to this hash! ); sub convert { return $DATES{$_[0]} }