jessarah has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I have a trigger that calls a perl script. The actions in the perl script activate the trigger again which in turns calls again the same perl script. This is done in a cascading way until the upper layer is reached.

triggerA: upper?no -> merge.pl -> commits -> triggerA : upper?no -> merge.pl -> commits -> triggerA upper?y -> end.

The process works as I see the commits in the upper branches, however the messages to the users console are lost except for the very first one in the series, which chronologically is the last one to be printed out.

I tried to put a sleep right after each call thinking that this might allow the messages to be printed before it returns to the calling parent, however does not work.

On the other hand when I turn on debug, which just causes a bunch of messages to be printed, all the messages are out even the ones I was missing before.

From the trigger which is also perl I use the following to call the merge.pl:

  system("/home/jessi/bin/merge.pl");

Any ideas what could be the problem... and how to fix it.

Thanks,
Jes

Replies are listed 'Best First'.
Re: Print messages not showing
by kcott (Archbishop) on Jul 12, 2012 at 13:14 UTC

    Without any code, responses will only be guesswork. Please have a read of How do I post a question effectively? which explains the type of information that will help us to help you.

    -- Ken

Re: Print messages not showing
by Anonymous Monk on Jul 12, 2012 at 11:27 UTC
      I tried:

      { my $ofh = select STDOUT; $| = 1; select $ofh; }

      the result is the same.