Perl: getting handle for stdin to be used in cgi-bin script
Posted
by Daniel
on Stack Overflow
See other posts from Stack Overflow
or by Daniel
Published on 2010-06-17T09:41:16Z
Indexed on
2010/06/17
11:33 UTC
Read the original article
Hit count: 196
perl
Using perl 5.8.8 on windows server I am writing a perl cgi script using Archive::Zip with to create on fly a zip that must be download by users: no issues on that side. The zip is managed in memory, no physical file is written to disk using temporary files or whatever. I am wondering how to allow zip downloading writing the stream to the browser. What I have done is something like:
binmode (STDOUT);
$zip->writeToFileHandle(*STDOUT, 0);
but i feel insecure about this way to get the STDOUT as file handle. Is it correct and robust? There is a better way?
Many thanks for your advices
© Stack Overflow or respective owner