> -----Original Message-----
> From: S. Johnson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 02, 2001 5:05 PM
> To: [EMAIL PROTECTED]
> 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?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]