in reply to Run Perl from within Perl

The first place to look is in the Perl documentation, of course. http://perldoc.com or type "perldoc" at your favorite shell's command line.
eval $some_perl_source;
do "filename.pl";
require "filename.pm";
use Packagename;
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.

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
    Hey Everyone,

    Thanks for the help, all of these suggestions are great!

    If everyone is really curious on why I would want to do such a thing, the answer is as follows:
    Cheers!