in reply to Troubles with m!(??{substr(...)})!

Can we have some sample data that you are trying to evaluate?

What happens if you don't use $_ as this may be getting corrupted durring the evaluation

Hope it helps
UnderMine