Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Help using Net::Telnet to use Rainbow

by Sidhekin (Priest)
on Oct 04, 2007 at 15:25 UTC ( #642677=note: print w/replies, xml ) Need Help??


in reply to Help using Net::Telnet to use Rainbow

$f = $pop->waitfor('//'); print "$f\n";

From the documentation, waitfor just returns success or failure in scalar context. I'd say you probably want to call waitfor in list context:

($f) = $pop->waitfor('//'); print "$f\n";

... or even:

($f, $match) = $pop->waitfor('//'); print "$f$match\n";

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!

Replies are listed 'Best First'.
Re^2: Help using Net::Telnet to use Rainbow
by downer (Monk) on Oct 04, 2007 at 16:03 UTC
    I found the problem. yes, I need to call waitfor in list context, but instead of "\r\n.\r\n", I tried just "\n.\n" and it works fine.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://642677]
help
Chatterbox?
[erix]: spies should use a type-writer, no power needed, no auditable
[erix]: if all else fails, eat the paper
[erix]: a few years ago there was suddenly the news that the Kremlin was using typewriters again. Heard nothing about it afterward
[erix]: (maybe that means it worked)
[oiskuu]: Yeah, it might work as long as there are no root exploits. ;-)
[Corion]: Also, it's much harder to leak paper sheets than it is to leak documents that are available electronically
[oiskuu]: tye, do you make use of remote logging?

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2017-06-23 20:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (555 votes). Check out past polls.