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!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|