Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$dir = 'modules'; $mod = 'test'; $pkg = sprintf("%s::%s",$dir,$mod); require $pkg; print test::func(), "\n";
thanks, Michael#code in modules\test.pm package test; sub func() { print "hello from test\n"; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: requiring perl modules
by chromatic (Archbishop) on Dec 03, 2003 at 17:59 UTC | |
by ysth (Canon) on Dec 03, 2003 at 19:28 UTC | |
|
Re: requiring perl modules
by hardburn (Abbot) on Dec 03, 2003 at 18:02 UTC | |
|
Re: requiring perl modules
by Zed_Lopez (Chaplain) on Dec 03, 2003 at 19:17 UTC | |
|
Re: requiring perl modules
by Anonymous Monk on Dec 03, 2003 at 18:57 UTC |