Read the documentation. I'm sure it'll tell you what happens if it fails to upload the file. Perhaps it returns false if that happens?
Once you know what happens after failure, you should be able to cater for that.
I would presume that your $ftp->put($new) or die "$server: cannot put $new: " . $ftp->message; would be sufficient myself...
If you're seeing cases where $ftp->put($new) is not returning false and if that's what the documentation says it should and the file is not being successfully transferred then that's a different matter, and one I can't help you with.
If you are seeing cases like that then you should try to identify under what circumstances that's happening. If you can identify the circumstances, and repeat the problem, but not fix it, then that would make an excellent SOPW question.
All the best,
jarich
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.