Hello,
Wondering if anyone can help me. I'm using the net::telnet to telnet to port 80 on a web server. I'm looking to do a "GET /" once i've connected. The problem is i'm having trouble getting my code to reckognize when the web server is ready for input. The web server responds with something like:
telnet www.yahoo.com 80
Trying 64.58.76.229...
Connected to www.yahoo.akadns.net.
Escape character is '^]'.
with the cursor below the last line. My theory is that i'm having problems because I need to match this last line that has nothing in it, of course I could be way off :( Everything I try doesn't seem to work.
Here's a small test program which illustrates my problem. I thank you all in advance for any help or pushes in the right dierction.
use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>10,
Errmode=>'die',
Port => 80,
Prompt => '/\'.$/');
$telnet->open('www.whatever.com');
$output=$telnet->cmd('GET / ');
print $output;
Thanks
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.