I don't know what you mean by saying "the program would freeze"; it looks like you're getting the "program done" printout at the end, so isn't freezing.
If you're using Windows, you might try using binmode() on your file handle (as well as checking for whether the upload succeeded):
if (!defined($file_handle)) { ... handle it ... }
$file_handle->binmode;
The reason you got an empty file when you did this: print OUTFILE $file_handle; is probably that $file_handle was undef. If it were a valid file handle, you'd have gotten something like "IO::File=GLOB(0x83b3ca4)" in your file (you can't print a file handle to another file and expect the file to get copied).
Also, if you're on Windows, make sure to binmode OUTFILE too.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.