execute another script and wait for it to finish

Ive tried to use the
use shell;
scriptname.pl

this executes the scriptname.pl but ends the original script So the original does not finish running it cuts it off about in the middle every thing is kinda half done any ideas
SpearmonAsked:
Who is Participating?
 
amitpagarwalConnect With a Mentor Commented:

try the following
....
system ("/usr/local/bin/perl -w script.pl") ;
...
0
 
Kim RyanIT ConsultantCommented:
shell is used to run Unix shell commands transparently within perl. I am not sure why you would want to use it to execute one perl script from within another. You could say

# your first perl script
require "scriptname.pl";
....some code
&main;  
.....

and create subroutines called main etc. inside scriptname.pl. Either that or make a module.
0
 
SpearmonAuthor Commented:
Im trying to avoid waiting for the script that im calling to finish before the main script completes the second script is indexing about a thousand meta tags and takes about 10 minutes to run
0
 
SpearmonAuthor Commented:
sorry about the title i ment to say and not wait for it to finish
0
 
ozoCommented:
If you want the other script to run at the same time as your main script, you might say
  system"script.pl &";
see also, fork/exec
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.