visshal has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.
  • Comment on Invoking Perl script from a perl script

Replies are listed 'Best First'.
Re: Invoking Perl script from a perl script
by bobf (Monsignor) on Oct 30, 2006 at 05:47 UTC
Re: Invoking Perl script from a perl script
by rafl (Friar) on Oct 30, 2006 at 05:31 UTC

    You could use do or require or eval combined with something that reads the file to execute. Safe is a slightly other way to eval some code. Another way, if you don't want to run the other script in the same interpreter as the current one, is to use system or something similar combined with $^X:

    system($^X, 'other_perl_script.pl', 'foo', 'bar');

    Cheers, Flo

Re: Invoking Perl script from a perl script
by valavanp (Curate) on Oct 30, 2006 at 06:33 UTC
    you can invoke in your perl script by the following statement.
    require 'test.pl';
Re: Invoking Perl script from a perl script
by chrism01 (Friar) on Oct 31, 2006 at 01:04 UTC
    If you want to communicate with another prog/process you may want: http://perldoc.perl.org/perlipc.html#Using-open()-for-IPC and Open2 / 3 further down the page