in reply to Re: Replace a hash key if it matches a regex
in thread Replace a hash key if it matches a regex

That doesn't seem to work:

>perl -wMstrict -le "$_ = 'BLAH01-ARRRGH0GAG'; s/-./$`$&/; print qq{'$_'}; " 'BLAH01BLAH01-ARRRGH0GAG'

Update: If  \K is available (5.10+), this works nicely:

>perl -wMstrict -le "use 5.010; ;; $_ = 'BLAH01-ARRRGH0GAG'; s{ .*? - \w \K .* }''xms; print qq{'$_'}; " 'BLAH01-A'