Perl: getting handle for stdin to be used in cgi-bin script
- by Daniel
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