[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: scared of our()



Chris Nandor writes:
: perl -Mstrict -wle 'our $foo = 1; print $foo; package Foo; print $foo'
: 
: One might expect that to print 1 twice, or to die.  It does neither.  It
: first prints $main::foo, then $Foo::foo.  I don't like this.  It scares me.

That's a known bug in my patch.  Sarathy was going to fix it to act
more like "my", since he was mucking around between stashes and pads
anyway for threading reasons.  So it will eventually be bound only
to $main::foo, and in this case print 1 twice as you hoped.

Larry


Follow-Ups from:
Gurusamy Sarathy <gsar@ActiveState.com>
References to:
Chris Nandor <pudge@pobox.com>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]