in reply to using an RE to consolidate repeated words

s#^(\w+)/$1_#$1_# should be s#^(\w+)/\1_#$1_#. $1 does not work in the match string, only in the replace string. You have to use \1 in the match string.


Perl is Huffman encoded by design.

Replies are listed 'Best First'.
Re^2: using an RE to consolidate repeated words
by jaa (Friar) on Aug 16, 2005 at 11:50 UTC
    Fab - thanks and kudos, just the pointer I was looking for!

    Regards,

    Jeff