Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I know in the above example I could simply load the module by using a require "testmod.pm"; however my real application requires loading from an array.use strict; open (MFILE, "testmod.pm") || die (...); my @mod = <MFILE>; close MFILE; if (eval "require @mod") { print "module loaded\n"; } else { print "module failed to load: $!\n"; } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Loading a Module from a Variable
by blazar (Canon) on Sep 21, 2005 at 13:50 UTC | |
|
Re: Loading a Module from a Variable
by davidrw (Prior) on Sep 21, 2005 at 13:22 UTC | |
by Anonymous Monk on Sep 21, 2005 at 13:32 UTC | |
by nobull (Friar) on Sep 21, 2005 at 16:46 UTC | |
|
Re: Loading a Module from a Variable
by Roy Johnson (Monsignor) on Sep 21, 2005 at 16:47 UTC | |
|
Re: Loading a Module from a Variable
by ruoso (Curate) on Sep 21, 2005 at 20:27 UTC |