Hi, 
 
 
You can do that with 'thread' or 'Acme::Spork'.
As for thread you can do something like:

__BEGIN__
use strict;
use warnings;
use threads;

sub getArray {
    my ($arg1,$arg2) = @_;


    my @output = `./myscript1.pl $arg1 $arg2`;
    return chomp @output;
}


my( $arg1, $arg2 ) = @ARGV;

### Note: The function that is run in the thread 
### is called in the same context as the call to create. 
### If you want the function called in a llist context, 
### you must call create in a list context.

my( $thrArray ) = threads->create( \&getArray, $arg1, $arg2, $filename );

### Do anything else the main thread needs to do here, *before* calling join.
### The joins will block until their threads complete.

### The values returned by the functions are returned when you join the thread.
my @array = $thrArray->join;

print "@array\n";
__END__
Hope that helps.
 
-- 
Edward WIJAYA
SINGAPORE

________________________________

From: Vishwanath Chitnis [mailto:[EMAIL PROTECTED]
Sent: Mon 10/16/2006 2:05 PM
To: beginners@perl.org
Subject: how to make a perl script run in background..?



hi all,

have a query ...

i wanted to call a perl script from another script and that should run in
the back ground..any idea how this can be achieved?

thanks in advance,

vishwa



------------ Institute For Infocomm Research - Disclaimer -------------
This email is confidential and may be privileged.  If you are not the intended 
recipient, please delete it and notify us immediately. Please do not copy or 
use it for any purpose, or disclose its contents to any other person. Thank you.
--------------------------------------------------------

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to