|
|
| XP is just a number | |
| PerlMonks |
how to properly handle the closing of pipe? read from the pipe unzip-c and get out beforeby mishin (Acolyte) |
| on Mar 29, 2011 at 14:05 UTC ( #896172=perlquestion: print w/ replies, xml ) | Need Help?? |
|
mishin has asked for the
wisdom of the Perl Monks concerning the following question:
What makes the script: read zip length of the desired piece and
comes from the cycle of reading early in order to save time P.S. : Everything happens on the productive $ Showrev Release: 5.10 Kernel architecture: sun4u Application architecture: sparc Hardware provider: Sun_Microsystems Kernel version: SunOS 5.10 Generic_142900-09 put additional perl modules I can not (like Archive:: Zip, IO:: Compress:: Zip) There is code in perl, which is ideally passes through perlclitic on Brutal (report all violation), but when the perl pipe_quest.pl unable to close: unzip-c test.zip utp.live.stp.published.messages.txt at pipe_quest.pl line 29 creates the file you want, but an error, how to handle this error correctly, that it was not? if you close $ FH; do not handle, the code does not pass on perlcritic Yes, and this may cause a memory leak if the file is large (> 10Gb) and close the pipe still need to be, controlling this leakage.
with best regards,
Mishin Nikolay,
web-programmer
Back to
Seekers of Perl Wisdom
|
|