Script doesn't return any error,but torrent isn't uploaded.
I haven't used WWW::Mechanize much but the first thing that leaps out at me is you are not doing any sort of error detection within the script. There are a couple of methods I'd suggest you read up on for the module the first being success() and the other being status()
$mech->get("http://localhost/TB_ALPHA/upload.php");
sleep 2;
warn "wait";
$mech->field('file', $torrent_file); #input torrent file
warn "wait $torrent_file";
$mech->field('name', $name); #file name
warn "wait $name";
$mech->field('descr', $descr); #description
warn "wait $descr";
$mech->value(3); #category
warn "wait";
$mech->click_button(value => "Do it!"); #Clicks do it
warn "wait";
That bit there makes me suspicious as well. I don't think it is doing what you think it is...
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
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.