I am using the Server Mode of the Rainbow Text Classifier. The classifier is fully trained, and is listening to a port (1821) on a server in my lab. The interface through telnet looks like this:
Trying 128.*******.12...
Connected to rhino.***.edu.
Escape character is '^]'.
i can then input whatever text I want, followed by a newline, a '.' and another newline (all input has to end with "\r\n.\r\n" and it sends back the results of the classification to my terminal. I'd like to automate this, but as this is my first time doing any kind of remote computing, I'm clueless. I've tried the following just to see what, if anything the server is sending me, but it only sends back '1'
use Net::Telnet ();
$hostname = "rhino.****.edu";
$pop = new Net::Telnet (Telnetmode => 0);
$pop->open(Host => $hostname,
Port => 1827);
$x = "Kingdom Hearts is a series of action role-playing games develope
+d and publ ished by Square Enix (formerly Square). It is the resu
+lt of a collaboration betw een Square and Disney Interactive Stud
+ios, and is under the direction of Tetsuya Nomura";
$x .= "\r\n.\r\n";
$pop->print($x);
$f = $pop->waitfor('//');
print "$f\n";
stupid code, to be sure, i'd just like to know the server is sending me something. I can't check even this. I beg the perl monks for wisdom. please advise me!
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.