Nick Ing-Simmons wrote:
> Rafael Garcia-Suarez <[EMAIL PROTECTED]> writes:
> >Mark-Jason Dominus (via RT) wrote:
> >>
> >> perl -le 'package D; eval q{print __PACKAGE__}'
> >>
> >> This prints "main", but it should print "D".
> >
> >This very simple patch appears to fix it :
>
> It may _change_ it, but is it a fix?
> __PACKAGE__ reflects the current package of the lexical scope.
> eval "" and require start a new scope.
A new scope, yes, but a new namespace ?
Given that my patch changed the behaviour of require'ing a file which
doesn't contain a package declaration, I'm happy to discuss this; but
the previous behaviour wasn't documented nor tested, and seems
surprising to me.
--
--Silence! What opera resembles a railwayline? Reflect, ponder,
excogitate, reply.
-- Ulysses