Solved

execute another script and wait for it to finish

Posted on 2000-02-18
5
140 Views
Last Modified: 2010-03-05
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
0
Comment
Question by:Spearmon
5 Comments
 
LVL 19

Expert Comment

by:Kim Ryan
ID: 2537503
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
 

Author Comment

by:Spearmon
ID: 2537731
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
 

Author Comment

by:Spearmon
ID: 2537732
sorry about the title i ment to say and not wait for it to finish
0
 
LVL 5

Accepted Solution

by:
amitpagarwal earned 150 total points
ID: 2537937

try the following
....
system ("/usr/local/bin/perl -w script.pl") ;
...
0
 
LVL 84

Expert Comment

by:ozo
ID: 2538849
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question