> I think what you are suggesting is using a communications protocol of
> some sort, which was a little more than I was thinking, but a very
> good idea none the less... (gotta remember to think outside the box)
Whoops.. accidentally fell into personal shorthand when talking to someone outside my own head. I didn't mean 'protocol' in the sense of adhering to TCP/IP, COM, or some other established standard. What I meant was something along the lines of 'implementation independent interface specification'.
See, when I think 'interface spec', I think about function signatures:
and while that's a necessary step on the road to shippable code, it's a truly rotten place to start. There's too much detail, and it's far too easy to get so bogged down in the minutae of 'how it works' that you lose sight of the big question: 'what does it do?'set_value (hash_key: string, key_value: string) : nil get_value (hash_key: string) : string
So.. I was really just suggesting you decide how to partition the system, then figure out what the pieces need to say to each other.
> I guess the quick answer (and hopefuly simplest)I was looking for was
> what are my options if I want to be able dynamically load modules
> into a perl program and then subsequently call them through out the
> program. From the research I've seen it might be possible to open the
> config file, parse through and loop through with an "eval" statement
> at every module...
I think I see where you're going. Yes, you can eval() code into a program:
$code = <<DONE; sub func { print "hello, world.\n"; } DONE eval $code; &func;
and you can get that code from an external file:
$file = '/some/file/path'; open (CODE, $file) or die qq(can't read "$file": $!); $tmp = $/ ; undef $/; $code = <CODE>; $/ = $tmp; close CODE; eval $code; ## and then run some function defined in that code.
mike
.
In reply to Re: Re: Re: Best/possible ways to dynamically use modules
by mstone
in thread Best/possible ways to dynamically use modules
by pdt1630
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |