Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: CRC Error on ZIP Files

by aitap (Curate)
on Mar 02, 2014 at 11:37 UTC ( [id://1076712]=note: print w/replies, xml ) Need Help??


in reply to Re^2: CRC Error on ZIP Files
in thread CRC Error on ZIP Files

print "@data";
This is your problem. Consider this code:
$ perl -E'@a=qw/1 2 3/; print "@a"' 1 2 3
You wanted to print your lines joined by empty string, but "@array" joins array elements with space (read $" for more info on that). Your original, commented-out approach is better: just read your file by, say, 10 kilobytes and immediately send the data to client:
{ local $/ = \10240; print while <$peunter>; }
In this example I tell Perl to read files with diamond operator (<$filehandle>) by 10240 bytes ($/) and loop printing the file pieces until I reach end-of-file.

Edit: corrected typo

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1076712]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found