in reply to elements not reversing inside a map

You are doing a 'reverse "filename.ext"' which reverses the string into "txe.emanelif". You want to perhaps do this:
> perl -le '$,=":";print reverse split /\./, "filename.ext", 2' ext:filename
Edit: I realize that you are actually wanting to split on the last 'dot' to get the extension; that's why you did the string reverse. Here's a better way:
perl -le '$,=":";print reverse( "filename.ext" =~ /(.*)\.([^.]+)$/ )'
Enjoy!
Ivan Heffner
Sr. Software Engineer, DAS Lead
WhitePages.com, Inc.

Replies are listed 'Best First'.
Re^2: elements not reversing inside a map
by Transient (Hermit) on May 05, 2005 at 21:29 UTC
    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

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

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