in reply to Scoping issues with code evaluation asserstions?

It seems you have inadvertently created a closure.

If you use local $ret = ''; in that sub, things should work.

Note, however, that by "work" I don't mean that it will return "" It will only return 1 when the ^(a) portion of the regex matches. That's because, if it doesn't match, the regex engine returns right away and never gets to your code assertion.

"My two cents aren't worth a dime.";