Gossamer Forum
Home : General : Perl Programming :

Call another script.

Quote Reply
Call another script.
Hi all,

I want to one script call another script but the first no need to wait for the second return the results.
How can do like this.

Thanks as always,

Beck
Quote Reply
Re: [Beck] Call another script. In reply to
 
require "script.pl";

sleep(1);

&some_sub_from_script.pl;

Either that or put sleep(1) inside the sub in script.pl before it returns.

Last edited by:

PaulW: Nov 24, 2001, 3:51 AM
Quote Reply
Re: [PaulW] Call another script. In reply to
sleep won't work on Win boxes. It's a *ix program. I think the equivalent on NT is 'wait' ??

- wil
Quote Reply
Re: [Wil] Call another script. In reply to
Sorry Wil, I'm afraid you are wrong.

>>sleep won't work on Win boxes.<<

Sure it will. Go here and tell me how long the script takes to load Tongue

http://213.106.6.135/cgi-bin/test.cgi

sleep is a perl function and works wherever perl is installed - unix or windows

LaughLaugh

Last edited by:

PaulW: Nov 24, 2001, 11:13 AM
Quote Reply
Re: [PaulW] Call another script. In reply to
Sorry Wil, I'm afraid you are wrong.

>>sleep won't work on Win boxes.<<

Sure it will. Go here and tell me how long the script takes to load Tongue

http://213.106.6.135/cgi-bin/test.cgi

sleep is a perl function and works wherever perl is installed - unix or windows

Or even better try it yourself! (preferably before telling me it won't work on windows Cool)

Code:
#!/perl/bin/perl

print "Content-type: text/html\n\n";

my $start = time;

sleep(10);

my $finish = time - $start;

print "I slept for " . $finish . " seconds";


LaughLaugh


Last edited by:

PaulW: Nov 24, 2001, 11:48 AM