in reply to Re^2: IPC::Run harness question
in thread IPC::Run harness question

"I'm actually not using package global variables."

Then you need to show the declaration of the lexical variables you are using.

In:

sub finish { ... $h = $self->{'h'}; ... }

The scope of $h is not confined to &finish but it should be. You don't show where it's declared or what else uses this $h (with global-like scope). When you move the code in &finish to another package, a different global-like $h will be involved.

In:

sub start { ... $self->{'h'} = h; }

I don't know what &h is doing: you don't show a sub h {...} definition. Maybe that's related to the problem. And, of course, h being a subroutine call is just a guess on my part: for all I know, it could be a directory handle.

I recommend you reduce this down to the shortest amount of code which reproduces the problem ["How do I post a question effectively?" provides guidelines for achieving this]. Doing so, may actually highlight your problem such that you can resolve it yourself. If it doesn't, at least there's something we can run without having to guess what code you haven't shown.

-- Ken

Replies are listed 'Best First'.
Re^4: IPC::Run harness question
by italdesign (Novice) on May 06, 2014 at 21:51 UTC
    Sorry about that Ken. I mistyped a few times even in the revised version. But it looks like the problem is actually due to forking and waitpid. I've posted it as a separate question, with complete minimum code this time.