in reply to Date Convert

Easiest way is probably to use strftime from POSIX.pm.

use POSIX 'strftime'; my $today = strftime '%d%m%Y', localtime; # assume filename is in $name $name =~ s/(\.\w+)$/$today$1/;

I'd also recommend using a more meaningful date format (like YYYY-MM-DD) as people from the US often misread DD-MM-YYYY as MM-DD-YYYY for some reason.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re: Re: Date Convert
by nite_man (Deacon) on Jun 10, 2003 at 15:33 UTC

    +++++++ Brilliant decision, especially s/(\.\w+)$/$today$1/.

    Live and learn ;-)
          
    --------------------------------
    SV* sv_bless(SV* sv, HV* stash);