Dan Sugalski wrote:
> At 02:09 AM 8/6/00 -0400, Chaim Frenkel wrote:
> >         uplevel 0, $Perl:Warnings=1;    # Hit everyone
> >         uplevel -1, $Perl:Warnings=0;   # Hit my wrapper
> Yeah, I can see that. We're going to need a mechanism to hoist things to
> outer scope levels internally (for when we return objects from subs) so it
> might be worth generalizing things.

Huh? I'm not sure if Chaim is proposing the same thing as Tcl's upvar,
but that's a hack to Tcl just to get pass-by-ref semantics. I'm not fond
of Tcl's uplevel hack either. Perl's already got references, dynamic
variables *and* lexical closures; we don't need Tcl's hacks.

It isn't clear to me why things like warnings can't be a flag on the
current lexical environment. It should be cheap enough to get at a flag
on the environment. (We already have a proposal to identify the magical
function __ at compile time. We might as well generalize that and identify
flags too.)

> > >>>>> "DS" == Dan Sugalski <[EMAIL PROTECTED]> writes:
> >DS> I'm not entirely sure that tossing the global nature of these things is a
> >DS> bad idea. It is kinda convenient to be able to mess with things (like
> >DS> $^W) and have them stay messed-with.

Using -w on the command line could have different semantics than turning
on $^W. Also, turning on $^W at the toplevel would allow all the nested
scopes to inherit it by default. Isn't that what we want?

- Ken

Reply via email to