----- Original Message ----- From: "Jackson, Harry" <[EMAIL PROTECTED]> > > -----Original Message----- > > From: [EMAIL PROTECTED] > > > > > > > > > use strict; > > > > my $link_id = ''; > > my $link_attr_entry_list_ref = ''; > > The var above is in the package::main name space.
Are you saying that $link_id and $link_attr_entry_list_ref are in the main name space? That's not quite right, is it? Refere to the following excerpt from the "Coping with Scoping" (http://perl.plover.com/FAQs/Namespaces.html) document that you mentioned: -------------- my variables are not package variables. They're not part of a package, and they don't have package qualifiers. The current package has no effect on the way they're interpreted. Here's an example: my $x = 17; package A; $x = 12; package B; $x = 20; # $x is now 20. # $A::x and $B::x are still undefined The declaration my $x = 17 at the top creates a new lexical variable named x whose scope continues to the end of the file. This new meaning of $x overrides the default meaning, which was that $x meant the package variable $x in the current package. package A changes the current package, but because $x refers to the lexical variable, not to the package variable, $x=12 doesn't have any effect on $A::x. Similarly, after package B, $x=20 modifies the lexical variable, and not any of the package variables. At the end of the file, the lexical variable $x holds 20, and the package variables $main::x, $A::x, and $B::x are still undefined. If you had wanted them, you could still have accessed them by using their full names. -------------- According to this, my understanding is that all my's live in a symbol table that is not connected to any package namespace. --Adam -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
