If the filehandle is STDOUT (already opened by web server), that sysseek fails, and _get_handle returns nothing, leading to the errors above. Running this under tests from a normal commandline (thanks Fastolfe), STDOUT is opened freshly and the sysseek succeeds (which is why a lot of tests from the commandline doing the exact same thing worked).sub _get_handle { my ($fh, $flags, $mode); sysseek ($_[0], 0, 0); or goto &_drat;
Removing the goto (?!) appears to let sysseek silently fail. If it can get to the beginning, it will, no harm, no foul. If it can't (like in the environment I'm working in), then it just continues on and prints the data successfully. Does that solution seem okay? What are the pitfalls with going with this solution?
In reply to The Problem & My Solution (please comment)
by Hrunting
in thread Tar File To Web Browser
by Hrunting
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |