Perl - Calling another perl script from a currenly running script
I am new to Perl scripting...
Anyone please help me regarding this issue...
I have a perl script ( such as a startup script or the initial script ) ... i have 5 others scripts ( which are like different scenarios and run after the startup script ) ..... i need not run all the 5 scripts always ... i run the startup script and i need to call the script based on any scenario ( among those 5 scenarios )... how can i do this????
Re: Perl - Calling another perl script from a currenly running script
You can use the backticks (`) to execute a system command:
Code:
$result = `random system command`;
This will execute "random system command" and then put the output of the command into $result.
Re: Perl - Calling another perl script from a currenly running script
Oops, forgot a follow-up.
Alternatively, if the scripts you want to run are Perl, you can use require:
Code:
#script 1
.. random code ..
if ( .. some condition .. )
require "myOtherFile.pl"
.. more random code ..
This will take "myOtherFile.pl" and dump the code into that spot.