On Thu, Oct 24, 2002 at 02:02:15PM -0400, Nikola Janceski wrote:
> local $\ = "\n";
> 
> now ... isn't local supposed to "modify the listed variables to be local to
> the enclosing block, file, or eval." ?
[snip]
> Am I just misunderstanding the use of local?????????????????

Yes, but the documentation isn't helping.  The best explanation I can give
you is http://perl.plover.com/FAQs/Namespaces.html#C_local_and_C_my_.  In
short, local squirrels away the current value of the variable, and replaces
it with undef.  The actions of local aren't reversed until the scope it was
called in is exited.

What you're seeing in your program is action at a distance, and this is the
primary reason 'my' was added, and why many of the special variables should
only be used in very limited circumstances.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to