Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Can't get cmd_remove_mode to work in Net::Telnet

by vek (Prior)
on Jan 15, 2009 at 21:38 UTC ( [id://736681]=note: print w/replies, xml ) Need Help??


in reply to Can't get cmd_remove_mode to work in Net::Telnet

According to the docs, $t->cmd_remove_mode(1) removes one line to be echoed. Is it possible the remote host is returning 2 lines, the first of which you are correctly suppressing but the second line is still echoed? Could you try setting cmd_remove_mode to 2 to see if that makes any difference?

$t->cmd_remove_mode(2); # so that we suppress two lines my @distro = $t->cmd(String => "cat /etc/redhat-release");

Also, check out the possibility of using option_accept()

-- vek --

Replies are listed 'Best First'.
Re^2: Can't get cmd_remove_mode to work in Net::Telnet
by gctaylor1 (Hermit) on Jan 15, 2009 at 21:44 UTC
    Thank-you! I can't believe I made such an oversight. I took the docs to mean the setting had to be -any- positive integer. I'd give you mega xp if I could. :)
      Also look at the option_accept() method, so you dont have to do this for every command. Then you can leave the echo mode on its default of 'auto'.

      ...reality must take precedence over public relations, for nature cannot be fooled. - R P Feynmann

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://736681]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-26 04:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found