in reply to Re: Re: Scoping issues with code evaluation asserstions?
in thread Scoping issues with code evaluation asserstions?
Could it be that the one-time compilation of the regex somehow causes the closure?
That's exactly what it is. Your regex() sub isn't the closure, the code in the regular expression code assertion is.
Also, saying local $ret = ''; breaks under strict:
Well of course it does. :-) (I should have mentioned that though.) Use our $ret = ''; or declare $ret with use vars qw( $ret ); instead. And keep in mind that whichever way you choose to declare it, it's still a global variable.
-sauoq "My two cents aren't worth a dime.";
|Replies are listed 'Best First'.|
Re: Re: Re: Re: Scoping issues with code evaluation asserstions?
by diotalevi (Canon) on Jun 19, 2003 at 19:17 UTC
by sauoq (Abbot) on Jun 19, 2003 at 19:34 UTC
In Section Seekers of Perl Wisdom