in reply to Troubles with m!(??{substr(...)})!
What happens if you don't use $_ as this may be getting corrupted durring the evaluation
Hope it helps UnderMine