> >    {
> >       here $/ = "\n";   # what it is in here
> >    }
>
> But it isn't "here" that's the problem.  If we just wanted to change
> the value "here", we could use my().  The problem is that local()
> changes the value for somewhere else as well as here.  Other names
> suggested (like "shadow", or "mask") convey that idea better than
> "here".

Yes and no, I think. If the code said:

   $^W = 1;
   {
       here $^W = 0;
       &mysub;   # no warning produced here
   }
   &mysub;       # warning produced here

   sub mysub {
       &produce_a_warning;
   }   

Whether or not a warning is produced is affected by the setting of $^W
within the current block. In the script itself, the "here" statement
would appear to be changing it elsewhere, but it's not. Remember that
the mysub call is being made within the current block. So I think "here"
is actually remarkably accurate, since it's only changing calls that are
made "here", inside this block. Even if the calls look like they cascade
to "elsewhere", they still originate "here", and so that's their true
scope.

Not that I'm necessarily fighting for my verbage, but I do think that's
a key distinction for this discussion.

-Nate

Reply via email to