-
June 26th, 2008, 04:30 AM
#1
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????
-
June 26th, 2008, 12:54 PM
#2
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.
-
June 26th, 2008, 12:57 PM
#3
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.
Last edited by IllegalCharacter; June 26th, 2008 at 01:01 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|