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

Platform: Windows 2000 & XP, Perl: 5.61, Module Version - Net::Telnet, version 3.03

Problem:

I'm using Net::Telnet to telnet from a Windows 2000 workstation to various network printers. I am able to connect successfully, but I'm unable to pass "/" to retreive the printers current settings. "/" works when I manually telnet. I am able to pass other commands, such as "menu" but "/" results in a time out regardless of the time out value I set. Although the menu command works this isn't a solution for me since the majority of printers don't use this command.

use Net::Telnet(); $t = new Net::Telnet (Timeout => 30, Errmode => 'return', Prompt => '/> $/'); $t->open("10.30.201.225"); @lines = $t->cmd("/"); #Fails with a time out message # @lines = $t->cmd("menu"); Works but isn't an option on most of the p +rinters in the environment. print @lines;

Any help would be appreciated, thanks.

Mitch

2005-10-12 Retitled by planetscape, as per Monastery guidelines
Original title: 'Net::Telnet'

Replies are listed 'Best First'.
Re: Sending a slash ('/') with Net::Telnet
by jcoxen (Deacon) on Oct 11, 2005 at 21:05 UTC
    Just the first thing that popped into my head...have you tried escaping the '/'?

    @lines = $t->cmd("\/");
    HTH

    Jack

      Yes and I tried using cmd('/') with single quotes as well.