Hi, Gisle Aas: > > What I meant to say was: Perl shares the actual symbol table slot when you > > import something; > > Wrong. If you do: > > package Bar; > use Foo qw(foo); > > Then you end up with \&Bar::foo and \&Foo:foo pointing to the same > function object, but the symbol table slots are independent. Right, actually; we're just miscommunicating. Let's state it differently: the situation is more like "use Foo qw($foo)" (you can't assign to &Foo::foo). After the "use", \$Bar::foo and \$Foo:foo point to the same scalar variable, thus $Foo::foo and $Bar::foo are the same variable and no longer independent (unless a different scalar or glob reference is stored in to *Foo::foo, but that's too much magic for a FAQ entry). In Python, Bar.foo gets set to the contents of Foo.foo when the import statement is processed, but the two variables are otherwise independent. -- Matthias Urlichs | noris network AG | http://smurf.noris.de/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4