Is it you that writes the "dynamic" code? If so, take a look at Exporter
Ciao!
--bronto
Update Some sample snippets. Your "dynamic" code could look like:
# This file is MyDynCode.pm package MyDynCode ; use strict ; use warnings ; use base 'Exporter' ; our @EXPORT = qw(dynamic) ; sub dynamic { print "runrunrunrunrun!!!" ; }
...and your code could import and run that function in a way like this:
use strict ; use warnings ; my $dynapack = 'MyDynCode' ; eval "use $dynapack" ; die $@ if $@ ; dynamic() ;
This one uses eval and use, but you could also use require and import: just change the eval and die lines with:
require "$dynapack.pm" ; import $dynapack ;
I hope this helps
# Another Perl edition of a song:
# The End, by The Beatles
END {
$you->take($love) eq $you->made($love) ;
}
In reply to Re: dynamic sub routine definitions?
by bronto
in thread dynamic sub routine definitions?
by Eradicatore
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |