in reply to Re: Are dynamic 'use' statements possible?
in thread Are dynamic 'use' statements possible?
Now I load DO_STUFF.pm into memory for mod_perl and at loading time I would assume that $conf is determined and that module is now loaded into memory space for use by DO_STUFF.package DO_STUFF.pm; BEGIN { use strict; use Exporter; use vars qw(@ISA @EXPORT); my $conf = determine_conf_module_name(); eval "use $conf;"; } do_stuff....etc...
during instantiation, like this:my $conf = determine_conf_module_name(); eval "use $conf;";
Or is the BEGIN{} block run only during instantiation of the object so I'm fine...?package DO_STUFF.pm; use strict; use Exporter; use vars qw(@ISA @EXPORT); ... sub new { my $conf = determine_conf_module_name(); eval "use $conf;"; ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: This works, but at what cost...?
by Aristotle (Chancellor) on Jul 02, 2002 at 22:48 UTC |