in reply to Loading a different Module depending on the Configuration
Basically you write one package that uses in all the others. The new method for that package just creates an object of the type you ask for and returns it. Each of your 'TheDB::' object inherits from, say, 'TheDB::Base'.package TheDb; use strict; use TheDb::PlainText; use TheDb::SQL; sub new { my $class = shift; my $type = shift; my $full_name = "TheDB::" . $type; return $full_name->new; } 1;
/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re2: Loading a different Module depending on the Configuration
by dragonchild (Archbishop) on Sep 26, 2001 at 21:44 UTC | |
|
Re: Re: Loading a different Module depending on the Configuration
by skazat (Chaplain) on Sep 27, 2001 at 08:31 UTC | |
by jeffa (Bishop) on Sep 27, 2001 at 20:22 UTC | |
by skazat (Chaplain) on Sep 28, 2001 at 01:21 UTC |