RE: [OT] Dynamically changing current package

2001-02-02 Thread Stathy Touloumis
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 --

RE: [OT] Dynamically changing current package

2001-02-02 Thread Robert Landrum
> > 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 wou

RE: [OT] Dynamically changing current package

2001-02-01 Thread Stathy Touloumis
> 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 modif

RE: [OT] Dynamically changing current package

2001-02-01 Thread Robert Landrum
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::})

RE: [OT] Dynamically changing current package

2001-02-01 Thread mgraham
> 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

Re: [OT] Dynamically changing current package

2001-02-01 Thread Robin Berjon
At 23:20 31/01/2001 -0800, Andrew Ho wrote: >AH>This isn't strictly a mod_perl question, but is there a good way in >AH>general Perl to dynamically change the current package name? > >GED>perldoc -f package > >I know how to use "package" in the normal case, where it's static. >However, you can't s

Re: [OT] Dynamically changing current package

2001-01-31 Thread G.W. Haywood
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.

Re: [OT] Dynamically changing current package

2001-01-31 Thread Andrew Ho
Hello, AH>This isn't strictly a mod_perl question, but is there a good way in AH>general Perl to dynamically change the current package name? GED>perldoc -f package 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 fo