Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Invoking Perl script from a perl script

by visshal (Initiate)
on Oct 30, 2006 at 05:23 UTC ( [id://581208]=perlquestion: print w/replies, xml ) Need Help??

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

This node falls below the community's threshold of quality. You may see it by logging in.
  • 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://581208]
Approved by graff
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-26 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found