If I was you I'd look into the module
LWP::Simple. This should be more than capable of doing what you're trying to do.
You will need to specifically look into the built-in
is_error(); function which if true means that LWP::Simple was not able to retrieve your document or image. You can then call your sub to warn the user of his or her's error.
I wouldn't really recommend doing this in a busy forum environment, though, as it is likely to be a slightly slow process and I would also consider making this optional for the user, as I know I would prefer to double-check by hand (if I was unsure) than having to wait that exrta second every time I post a message. Just my opinion...
Hope this helps.
- wil
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.