This works great :)

Still curious what's in that line, but ...  

Is there a way to show the raw output?

On Wed, 2003-01-08 at 14:52, John W. Krahn wrote:
> Jason Frisvold wrote:
> > 
> > Hi all,
> 
> Hello,
> 
> >         I'm using the Net::Telnet module to automate some of the more menial
> > tasks I have to deal with every so often.  Part of the task requires
> > parsing a stream of data from the device I'm telnetting to (A Marconi
> > ASX-200 to be exact) ...  I've successfully set up the telnet, logged
> > in, and executed the proper commands.  Now, however, I need to retrieve
> > data from the device.  I can submit the command and use getline() to
> > retrieve lines, one at a time, and parse it.  However, there are
> > "hidden" characters here and I don't know how to determine what they
> > are.
> > 
> > Here is a quick snippet of the code :
> > 
> > $Telnet->print("sec log sho");
> > while (my $line = $Telnet->getline(Timeout => 5,)) {
> >         chomp $line;
> 
> Instead of chomp (because this will remove newlines as well) use this:
> 
>         # remove every character NOT in the range ' ' to '~' inclusive
>         $line =~ s/[^ -~]+//g;
> 
> 
> >         print "--->>>>$line<<<<---\n";
> > }
> 
> 
> 
> John
> -- 
> use Perl;
> program
> fulfillment
-- 
---------------------------
Jason H. Frisvold
Backbone Engineer
Penteledata Engineering
[EMAIL PROTECTED]
RedHat Certified - RHCE # 807302349405893
---------------------------
"Something mysterious is formed, born in the silent void. Waiting alone
and unmoving, it is at once still and yet in constant motion. It is the
source of all programs. I do not know its name, so I will call it the
Tao of Programming."

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to