duaneb has asked for the wisdom of the Perl Monks concerning the following question:

I'm writing a script that uses Net::Telnet::Cisco to manipulate Cisco devices. Well, we installed some new HP switches. Good news? It uses the same basic shell setup, so I should be able to access them using Net::Telnet::Cisco. Bad news? It makes heavy use of vt100 escape sequences, which Net::Telnet[::Cisco] chokes on.

What should I do? Should I write my own parser for the hp switches? Should I hack the existing modules into submission? or should I try some other approach entirely?

Replies are listed 'Best First'.
Re: vt100 parsing
by pc88mxer (Vicar) on Jun 30, 2008 at 16:24 UTC
    How about using Term::VT102? You can use this module as a filter for the escape codes by establishing a callback for the OUTPUT handler.

    Also, it looks like the only place Net::Telnet (a base class for Net::Telnet::Cisco) reads from the socket connection is in the _fillbuf method. So you could override that method to filter out the escape codes.

    Ideally there would be a way to tell the HP switch that you are a dumb terminal.