in reply to ${^POSTMATCH} problem

I can't run many tests right now, but what you describe sounds like a side effect / evaluation order problem with using this special variable multiple times inside the same statement.

(Similar with using func($x++,$x--) where the evaluation order is undefined and aliases are passed)

Splitting the statement into multiple ones with just one postmatch should fix it.

I'll try later...

Update

See Re^2: ${^POSTMATCH} problem

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery