I need to run my perl program as a clone because I am
calling it from within another application that intend
to talk back to. The application's execute command
wants to wait until the call to perl program is
finished before continuing.
I had this working at one time and now it seems to not
work ( I dredged up some old code from an older
project ). I think it is actually running a new
version of the program but it is not accepting a value
I pass it to test whether it is really a clone or not.
Here is what I have (that used to work at one time):
BEGIN {
if ($ARGV[0] !~ /^-/) {
if ($^O =~ /MSWin32/i) {
if ($ARGV[0] ne "clone") {
exec("$0 clone @ARGV") or die "Couldn't clone
myself. $!\n";
} # end if
if ($ARGV[0] eq "clone") {print "CLONED!\n";shift
@ARGV};
} # end if
else {
if ($pid = fork) {sleep 1;exit;};
if (! defined $pid) {die "Couldn't clone myself.
$!\n"};
} # end else
} # end if
} # end block
I am not getting the message that it couldn't clone
itself - I am just getting continously re-starting of
the program ... so that tells me the pseudo-clone is
working but my test is failing...
Any clues on what I am missing?
Thanks,
John
=====
John V. Pataki
Logged in to my Yahoo Mail account on the web.
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs