in reply to Re^4: Multiple uses of (?{ code }) do not appear to be called
in thread Multiple uses of (?{ code }) do not appear to be called

If you don't specify the local modifier then @o is visible outside the scope. I.e.
use strict; { local our $a = "A"; } { our $b = "B"; } print "a = $a\n"; print "b = $b\n"; __DATA__ a = b = B

Replies are listed 'Best First'.
Re^6: Multiple uses of (?{ code }) do not appear to be called
by rhesa (Vicar) on Dec 29, 2006 at 22:00 UTC
    See, this is why ourperl is so confusing :-)

    You are bitten by the magic of $a and $b:

    #!/usr/bin/perl -l use strict; { local our $x = "A" } { our $y = "B" } print "x=$x"; print "y=$y"; __END__ Variable "$x" is not imported at our2.pl line 7. Variable "$y" is not imported at our2.pl line 8. Global symbol "$x" requires explicit package name at our2.pl line 7. Global symbol "$y" requires explicit package name at our2.pl line 8. Execution of our2.pl aborted due to compilation errors.
      Yes, my mistake, you are completely right. Localizing $a is a common thing to do but not the way I put it.