in reply to Re: elements not reversing inside a map
in thread elements not reversing inside a map

Unfortunately, that will not do what I want when the filename contains a '.'
perl -le '$,=":";print reverse split /\./, "filename.200505.ext", 2' >200505.ext:filename
when I would want (unbeknownst to all) ext:filename.200505

Replies are listed 'Best First'.
Re^3: elements not reversing inside a map
by eibwen (Friar) on May 06, 2005 at 00:11 UTC

    To parse the file extension, just capture the text following the last .:

    $filename =~ /(?<=\.)([^.]+)$/;