On Thursday 06 September 2001 06:01 pm, Garrett Goebel wrote:
> From: Ken Fox [mailto:[EMAIL PROTECTED]]
>
> > I think we have a language question... What should the following
> > print?
> >
> >   my $x = 1;
> >   my $y = \$x;
> >   my $z = 2;
> >   %MY::{'$x'} = \$z;
> >   $z = 3;
> >   print "$x, $$y, $z\n"
> >
> > a. "2, 1, 3"
> > b. "2, 2, 3"
> > c. "3, 1, 3"
> > d. "3, 3, 3"
> > e. exception: not enough Gnomes
> >
> > I think I would expect behavior (c), but it's not obvious to me.
>
> I would have said (c) as well.
>
> And if I can figure it out... it ain't that tricky.

%MY:: ain't no different than %main::, except its contents are heaviliy 
restricted to the current scope level.  Whatever you used to be able to do 
with globals, you'll now be able to do with lexicals.  You just lose the 
globalness of it.

-- 
Bryan C. Warnock
[EMAIL PROTECTED]

Reply via email to