You'd need to have declared $ret as a global somewhere for local to localize it. Remember that local() declares nothing.
use vars '$ret'; sub regex { local $ret = '';
What you didn't realize was that the (?{ ... }) is a closure so when it first ran it captured the original $ret and continued to write to that same instance which wasn't the same one being returned in later iterations.
In reply to Re: Re: Re: Scoping issues with code evaluation asserstions?
by diotalevi
in thread Scoping issues with code evaluation asserstions?
by Cirollo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |