blue_cowdawg has asked for the wisdom of the Perl Monks concerning the following question:
OK: my sick mind has come up with something and I'm trying to figure out how to do it:
Let's say I have three modules defined as:
and somewhere in some main package I have:package Top; use Moose; 1; package SubordinateA; use Moose; extends 'Top'; 1; package SubordinateB; use Moose; extends 'Top'; 1;
is there a way from within either Top or one of the subordinate modules to change $obj to be reblessed as either SubordinateA or SubordinateB?#!/usr/bin/perl -w use strict; use Top. my $obj = Top->new(); | etc.
What I'm trying to accomplish is during Top's execution in some sub based on some conditionals instantiate either of the subordinate modules (six actually) and pass that blessed object back to the calling environment.
Does my question make sense?
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: any way to fill calling namespace with a "use Module"?
by tobyink (Canon) on Feb 23, 2013 at 20:32 UTC | |
by blue_cowdawg (Monsignor) on Feb 23, 2013 at 21:56 UTC | |
by tobyink (Canon) on Feb 23, 2013 at 22:54 UTC | |
Re: any way to fill calling namespace with a "use Module"?
by Corion (Patriarch) on Feb 23, 2013 at 19:46 UTC |
Back to
Seekers of Perl Wisdom