in reply to Re: File::Temp::tempfile : name versus handle
in thread File::Temp::tempfile : name versus handle
Ok. Thanks for the clarification. I'm also reviewing the manual page for File::Temp again to see what I may have missed the earlier times. It often helps to try re-reading on a different display device.
As for the code snippet, the pipe gets opened and closed immediately because as it stands the output from the process it calls goes to the temporary file which is read later on further down in the script. The only errors (I think) that could be caught from the open/close itself would be handled by the or die() part. The reason for a two-step approach is that otherwise the diagnostic messages from the program, "tidy", go to stderr and I have not found a way to redirect stderrr properly under Fast-CGI. So I figure the temporary file is the way to go and to leave stderr alone. I tried a lot of ways to redirect stderr, documented and made up, which all work from the shell, but do not work via Fast-CGI.
The data does not need to be in a file, it can be read as strings maybe better. It's just that the stderr issue with Fast::CGI seems to prevent that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: open/close and stderr
by haukex (Archbishop) on Mar 22, 2018 at 21:25 UTC | |
|
Re: open/close and stderr
by marto (Cardinal) on Mar 22, 2018 at 15:29 UTC | |
by mldvx4 (Hermit) on Mar 22, 2018 at 15:45 UTC | |
by marto (Cardinal) on Mar 22, 2018 at 15:54 UTC |