in reply to Re: Inexplicable uninitialized value when using (?{...}) regexp construct.
in thread Inexplicable uninitialized value when using (?{...}) regexp construct.
I must have been wrong when I said:
I have also tried using $num (and the other variables used within the regexp) as package globals, with our, as well as with use vars, thinking that maybe lexical scoping was causing my pain. In so doing, I declared those variables at the top of the script to give them the broadest possible exposure. Again, no change; the second snippet fails, and the first snippet works great.
I guess I wasn't atomic/careful enough in my testing. In converting to globals I may have broken something else, because you're right; after re-testing, converting to globals makes the script work.
Based on your, and others' comments I dove back into perlre to see if I could find mention that lexicals are quirky when used within (?{...}) constructs. I didn't find any such warning, aside from the familiar "This feature is considered highly experimental", applied to the construct as a whole. Should this be submitted as a documentation patch? Is this topic addressed elsewhere in the POD?
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Inexplicable uninitialized value when using (?{...}) regexp construct.
by BrowserUk (Patriarch) on Sep 29, 2004 at 00:24 UTC | |
by davido (Cardinal) on Sep 29, 2004 at 01:15 UTC | |
by BrowserUk (Patriarch) on Sep 29, 2004 at 01:36 UTC | |
|
Re^3: Inexplicable uninitialized value when using (?{...}) regexp construct.
by diotalevi (Canon) on Sep 28, 2004 at 22:55 UTC |