NewPackage will then contain all things in TestPackage
Then you can redefined everything in TestPackage without affecting
anything in NewPackage.
Actually it will, if you were to delete NewPackage, TestPackage would not
contain anything. Modifying 'thingys' in TestPackage would modify
Probably just never assumed to be used this way. Do not see to much
documentation on using the Symbol table directly. Here is something strange
as well. Try copying a package and then creating an object from it . . .
Really funky
Think I might post this to the p5p list
Andrew Ho [EMAIL PROTECTED] wrote:
I know how to use "package" in the normal case, where it's static.
However, you can't say "package $foo" or even "eval 'package
foo'" or even "BEGIN { eval 'package foo' }." I'm wondering
if there's any way short of hacking the Perl source itself
to
You can also change the package using globs.
*{NewPackage::} = *{TestPackage::};
NewPackage will then contain all things in TestPackage
Then you can redefined everything in TestPackage without affecting
anything in NewPackage.
You can also do something like
for my $name (keys %{Test::})
NewPackage will then contain all things in TestPackage
Then you can redefined everything in TestPackage without affecting
anything in NewPackage.
Actually it will, if you were to delete NewPackage, TestPackage would not
contain anything. Modifying 'thingys' in TestPackage would modify
Hello,
This isn't strictly a mod_perl question, but is there a good way in
general Perl to dynamically change the current package name?
Thanks in advance--
Humbly,
Andrew
--
Andrew Ho http://www.tellme.com/
Hi Andrew,
On Wed, 31 Jan 2001, Andrew Ho wrote:
This isn't strictly a mod_perl question, but is there a good way in
general Perl to dynamically change the current package name?
perldoc -f package
73,
Ged.