in reply to Run Perl from within Perl
eval $some_perl_source;
do "filename.pl";
require "filename.pm";
I would say that these examples are roughly in order of "maturity." By that, I mean, more mature projects tend to use methods further down in this list, rather than methods earlier in this list.use Packagename;
Whether it's a good idea depends on what you want to accomplish, where you get the code you've got, how much your sub-script needs to be isolated or integrated within the current script, and how much you trust the code you're running to do what you expect and nothing tricky.
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Run Perl from within Perl
by SmokeyB (Scribe) on Feb 28, 2005 at 19:46 UTC | |
by Joost (Canon) on Feb 28, 2005 at 20:35 UTC |