open (FILE, ">:raw:perlio" . $att->{filename});
:raw removes default layers which may transform the data being printed. :perlio reintroduces buffering.
> instead of >> replaces existing files instead of corrupting existing files by appending to them.
Update: Added explanations.
In reply to Re: Downloading Gmail attachments - Corrupted saved file
by ikegami
in thread Downloading Gmail attachments - Corrupted saved file
by casimo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |