http://www.perlmonks.org?node_id=896220


in reply to Re^3: how to properly handle the closing of pipe? read from the pipe unzip-c and get out before
in thread how to properly handle the closing of pipe? read from the pipe unzip-c and get out before

unzip fixed - yes,but error after the close of the pipe is still
$ perl pipe_quest.pl
unable to close: unzip -p test.zip utp.live.stp.published.messages.txt at pipe_quest.pl line 29
mishin
  • Comment on Re^4: how to properly handle the closing of pipe? read from the pipe unzip-c and get out before

Replies are listed 'Best First'.
Re^5: how to properly handle the closing of pipe? read from the pipe unzip-c and get out before
by Illuminatus (Curate) on Mar 29, 2011 at 19:23 UTC
    Another check of the unzip man page yields the likely reason for your problem. Closing a pipe causes the writer (unzip in this case) to receive SIGPIPE. unzip subsequently returns a non-zero exit status (sets $? to SIGPIPE, or 13), which may be causing croak to fire. You may want to change you logic to not croak if the close fails, but $? is set to 13

    fnord

      Finishing variant,many thanks, perlcritic brutal - Ok
      with best regards, Mishin Nikolay, web-programmer