I was using $\ globally for a larger script, but it adverse affects. Thanks to you and Jenda I now know that local doesn't act exactly like my.
local() should be explained by it globally changing a variable but only to the end of the file/block/eval and my() makes a variable only exist, uniquely, within the encloseing file/block/eval. Thanx to all for clearing that up for me. :) Nikola Janceski ....like you walked out of the desert with the camel on your back. > -----Original Message----- > From: Michael Fowler [mailto:michael@;shoebox.net] > Sent: Thursday, October 24, 2002 4:23 PM > To: Nikola Janceski > Cc: Beginners (E-mail) > Subject: Re: local()! Explain, please? > > > On Thu, Oct 24, 2002 at 03:24:14PM -0400, Nikola Janceski wrote: > > Then I am really confused, how can I cause the scope of $\ > to extend only to > > the end of the file and not into the other modules?? > > You can't. However, you might be able to confine your local > version of $\ > to only those operations you want. I tried to go back to > your original code > to give you an example of this, but it wasn't clear to me > what exactly you > wanted affected by your version of $\, and what should've > been left alone. > > > > #!yourperl > > my $\ = "\n"; > > __END__ > > > > I get this error: > > > > Can't use global $\ in "my" at /usr/nj/pl.pl line 4, near "my $\ " > > Execution of /usr/nj/pl.pl aborted due to compilation errors. > > These special variables are global. Even if you could manage > to lexically > scope them they wouldn't be the same variable any more than > the two $foo > variables would be with 'our $foo; my $foo;' > > > Michael > -- > Administrator www.shoebox.net > Programmer, System Administrator www.gallanttech.com > -- > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ---------------------------------------------------------------------------- -------------------- The views and opinions expressed in this email message are the sender's own, and do not necessarily represent the views and opinions of Summit Systems Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]