Maybe this is a line ending issue (especially if running this on non-Linux/Unix systems).
Try adding ':raw' to the mode in your open call:
open($fh, '>:raw', "$filepath" . "$_->{filename}");
In reply to Re: Saving PDF files from gmail
by RonW
in thread Saving PDF files from gmail
by anonymonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |