Help with Net::Telnet module

I am looking for some help debugging a problem with the Net::Telnet module
written by Jay Rogers.

Here's the subroutine I am having problems with:

sub login
  {
   $errmode = 'return';
   $hostaddress = 'xxx.xxx.xxx.xxx'; 
   $prompt = '/Sheldon_NS16>/';
   $username = 'xxxxxxxx';
   $password = 'xxxxxxxx';
   $obj = new Net::Telnet ( Host => $hostaddress,
		              Errmode => $errmode,
   		              Prompt =>  $prompt,
   		              Timeout => 15,
 		              Port => 23 );
  $obj->login($username, $password);  # line 212
  $errmsg = $obj->errmsg;
  print STDOUT "Error - $errmsg\n" unless ($errmsg eq "");
  }

This subroutine is part of a larger script (sheldon.pl) that calls this
subroutine once per minute
 to login to a modem pool to get user information and log it for tracking
users usage.  
The program will run for 1-2 days before dying.  The error I get is as
follows:

Can't call method "login" on undefined value at ./sheldon line 212.

As I said above, the script will run for a day or two collecting data
without any problems, then
die with the error above.  Any Perls of wisdom out there?

Thanks, 

Sean Johnson

0
zatharus
8/2/2001 9:04:52 PM
perl.beginners 29388 articles. 4 followers. Follow

1 Replies
809 Views

Similar Articles

[PageSpeed] 48

> -----Original Message-----
> From: S. Johnson [mailto:zatharus@ncn.net]
> Sent: Thursday, August 02, 2001 5:05 PM
> To: beginners@perl.org
> Subject: Help with Net::Telnet module
> 
> 
> I am looking for some help debugging a problem with the 
> Net::Telnet module
> written by Jay Rogers.
> 
> Here's the subroutine I am having problems with:
> 
> sub login
>   {
>    $errmode = 'return';
>    $hostaddress = 'xxx.xxx.xxx.xxx'; 
>    $prompt = '/Sheldon_NS16>/';
>    $username = 'xxxxxxxx';
>    $password = 'xxxxxxxx';
>    $obj = new Net::Telnet ( Host => $hostaddress,
> 		              Errmode => $errmode,
>    		              Prompt =>  $prompt,
>    		              Timeout => 15,
>  		              Port => 23 );
>   $obj->login($username, $password);  # line 212
>   $errmsg = $obj->errmsg;
>   print STDOUT "Error - $errmsg\n" unless ($errmsg eq "");
>   }
> 
> This subroutine is part of a larger script (sheldon.pl) that 
> calls this
> subroutine once per minute
>  to login to a modem pool to get user information and log it 
> for tracking
> users usage.  
> The program will run for 1-2 days before dying.  The error I get is as
> follows:
> 
> Can't call method "login" on undefined value at ./sheldon line 212.
> 
> As I said above, the script will run for a day or two collecting data
> without any problems, then
> die with the error above.  Any Perls of wisdom out there?

I don't know anything about Net::Telnet, but I'd say the call to
Net::Telnet::new is failing for some reason. You're not checking the return
value from new(). Perhaps there is a way to do that?

0
Bob_Showalter
8/2/2001 9:34:09 PM
Reply:

Similar Artilces:

Help :-) Beginner in ASP.NET ... Help in Datagrid
Hi , I'm a novice to the ASP.NET/ADO.Net field. I have a datagrid web control in which i show data that is read from a table(assume table has just one field called I_status ). Every row in the datagrid has a button control column called "Update" (created using <asp:ButtonControl ButtonType="PushButton" > ). My case is that upon clicking the Update button in any row, i need to set the column entry for I_Status field (for that particular row in which Update button was clicked) to value 0. I am writing the following code for the gridEvent Handler Sub grdSit...

Help with net::telnet
Hi, I am trying to get Perl telnet to work on our *nix boxes, and I am missing something. I'm sure it is obvious. If anyone can help. I would appreciate it. Listed below is the code I use and the login screen from one of our FreeBSD boxes (sparky). +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ #!/usr/local/bin/perl -w use Net::Telnet (); $username = "sqa"; $passwd = "sqa"; $machine = "sparky"; print $t = new Net::Telnet (Timeout => 10, Prompt => '/$username\@$machine\#/'); print $t-...

Net-Telnet Module
Hello: I am in the process of setting up a Solaris 8 box that will monitor 4 different systems for my company. I want to make it idiot proof in that if it ever gets rebooted, I want it to automatically xterm back into the 4 boxes that it is monitoring. I have sucessfully created a script that will xterm into a different machine, but I do not know how to send commands to the xterm after it is opened so I can launch openview. Any Ideas? Brian ...

HELP!HELP!HELP!HELP!HELP!HELP!
I was using powerbuilder4.0 a month ago I decided that migrate it to PB7.0 When Im using 4.0, in datawindows I was using extra colums additional to stores procedure. I mean that for example; stored proc. returns 4 columns. I was using 2 extra columns to modify something from client. But I cant do the same thing in PB7.0. How can I do that??? please help. Gurcan yucel gyucel@infina.com.tr "I was using 2 extra columns to modify something from client." what does this mean that you added to the result set? If so then just goto the SQL and add a param. Then set the...

Help Help Help Help Help Help
------=_NextPart_000_0074_01C2960E.EBE13A30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Can someone please help me. I have installed mysql on Unix Solaris and it works fine I have Perl installed previously which is working and with which i have installed other perlmodules before and are working fine. I have also installed DBI and it works fine with the Sybase drivers which i have installed. When i tried to install the Msql-Mysql-modules-1.2219 drivers i get the following error. # make /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/...

Net::Telnet --help required
------=_Part_19101_13362803.1179309892857 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello, I am trying to telnet to all m/c for which i haven't set password(only root is a valid user) any body can telnet using root user But when i try to access through perl it <snip> use warnings; use Net::Telnet; my $t = new Net::Telnet (Timeout => 10,Prompt => '/bash\$ $/'); my @line; $t->open("host1"); $t->waitfor('/login:.*$/'); $t->print("root"); $...

Help Help Help Help
i need to create a crosstab report using Crystal reprot for VS 2003 i face aproblem when i need to order my Fileds by their names my data must be like this Basic Cola Housing Gross Deduction1 Deduction2 Deduction3 Net but when i run my report it give my a not sorted data acutally i have acode field which can i order field using it. but i don't knwo how to do thisSo..................? Select Report tab | |-->Select Record Sort expert Choost the fields you want to sort --Select the corresponding sort direction f...

Help required about NET::TELNET
------=_Part_24326_2033954.1133781558079 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi Folks, I have installed the module NET::TELNET from CPAN and when i try to execute the below simple pgm, --------------------****************************----------------------- use Net::Telnet; $telnet =3D new Net::Telnet ( Timeout=3D>100,Errmode=3D>'die'); $telnet->open('202.177.129.37'); $telnet->waitfor('/login: $/i'); $telnet->print('root'); $telnet->waitfor(...

help help help help
Name: chef mario Email: chefusa_at_pacbell.net Product: Firefox Summary: help help help help Comments: Heard great reports about Firefox!!! Downloaded & installed Firefox !!!! Lost All my very very valuable BOOKMARKS!!! CAN ANYONE HELP!!!!! All bookmarks were in Internet Explorer Did bookmark transfer to Firefox. Seem the Fox eat all m,y bookmarks Need serious help anyone. chef mario Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051025 Firefox/1.5 ...

Help Help Help DataWindow.NET 2.0
Hello, i am using datawindow.NET 2.0 evaluation version my application is working fine using Pbls as source for objects as soon as i change the Pbl to PBD the application gives the error object not found however help says that u can use PBDs kindly tell me that this error is due to evaluation version or there is something wrong i am very worried about this behaviour because i have to report to my project manager for this behaviour of datawindow.NET kindly reply thanks Haroon Yes PBDs will work with the evaluation version. Is this a web forms or Windows Form...

Beginner Help: ODBC/ASP.NET
I'm an absolute beginner, and I need a little help. System DSN name: sampledata (maps to sampledata.mdb in c:\data folder) (Has one table called test, with one column called myfield. I entered four sample rows, so myField contains 1, 2, 3, 4, that's it). I'm using ASP.NET Web Matrix editor. I have dotNET Framework 1.1 installed on my machine. I don't have any other tool. (there's actually a restriction I can't go into right now) I simply need to display the data from the table in the webpage in a table format, in the simplest way possible. Period. Ca...

A beginner in ASP.Net need help
Hi, I am new in ASP.Net. I now doing a sys using VB.Net n SQL Server 2000. I keep getting the same error for my login page, can somebody help me point out where is the problem? I really need help urgently.  Below are the error message I get: Server Error in '/e-library' Application.-------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriate...

HELP HELP HELP
i need help, i use an dbmaker 3.0 server and now i want to use an client to go on it but i dont have an client(i have dbmaker 3.6 but it don't work) who can help me with the dbmaker 3.0 client (tools,files,drivers) email me kelly.kloen@siteways.nl ...

help help help
i wanna know the list of compite time errors related to code correction/programming errors in powerbuilder.thanks lot cenk That's a pretty big request. You want a list of everything it is possible to do wrong in PowerBuilder? What you might want to do is search the solved cases infobase on the Sybase web site. On Tue, 15 Jun 1999 11:50:32 +0300, in powersoft.public.powerbuilder.general cenk KIZILDAG <cenk1536@yahoo.com> wrote: >i wanna know the list of compite time errors related to code >correction/programming errors in powerbuilder.thanks lot > >c...

Web resources about - Help with Net::Telnet module - perl.beginners

Resources last updated: 12/6/2015 7:17:53 PM