Sonika Sachdeva wrote:

Hi,

Hello,

I need to run " perl sample.pl $filename " from a perl program . The output
is a zip file which needs to be processed further.

use Acme::Spork;

my $spid = spork(sub {
    qx( 'perl sample.pl' . join('', @_) );
}, $filename) or die "Could not fork for spork: $!";

print "Your sample is building, its PID is $spid\n";


or you could wait for it (and give progress indicators, etc) by using:

http://search.cpan.org/~dmuey/Unix-PID-v0.0.6/PID.pm#%24pid-%3Ewait_for_pidsof()

If you exec or fork or whatever in the spork call $spid won't be the one you're looking for...

HTH :)

--
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