in reply to Re: Perl OO: switch package context.
in thread Perl OO: switch package context.
OK, that works indeed. But (oh, I know it is cruel) I need to do that at runtime, within eval context.
So:
use aliased Foo::Bar::Object; print ref Object->new();
works, so works this one:
use constant Object => 'Foo::Bar::Object'; print ref Object->new();
But eval'ing this stuff does not:
eval 'use aliased Gemini::Model::Object;'; print ref Object->new();
or:
What's wrong with that? :)eval qq[use constant Object => 'Foo::Bar::Object';]; print ref Object->new();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl OO: switch package context.
by bart (Canon) on May 15, 2005 at 20:45 UTC |