in reply to two questions about Win32::Process

You really need to use Win32::Process ?

This module is design for call external programs (not created with perl)... Try use Perl's language and resources to do it.

See perlipc's Background-Process and fork references.

Skel code:

use strict; use warnings; my $pid = fork(); unless ( defined($pid) ) { die "fork failure! "; elsif ( $pid ) { # child $SIG{HUP} = sub { print "HUP signal\n"; }; sleep(5); #-->> if use an external script, and not a file with parameters #>>>> reguire 'c:\perl\progs\garbl.pl'; exit 1; } sleep(2); kill(15,$pid);

other resources: waitpid, wait, alarm...

--
Marco Antonio
Rio-PM

Replies are listed 'Best First'.
Re^2: two questions about Win32::Process
by dannoura (Pilgrim) on Apr 29, 2005 at 23:42 UTC

    Thanks. Only problem is I can't use fork. I tried but it doesn't seem to work too well on Win32, a fact which I saw was discussed a lot on SoPW. Open and IPC seem like a possible solution.