Dear all,
I have written following script to loin to router bu it is showing error.
Can't locate object method "new" via package "Net::Telne t" (perhaps you forgot t
o load "Net::Telne t"?) at h.pl line 9.
pls help me to rectify the problem
I have written following script to loin to router bu it is showing error.
Code:
#!c:\Perl\bin; use strict; use warnings; my $hostname = '[I]REMOVED FOR YOUR PROTECTION[/I]'; my $password = '[I]REMOVED FOR YOUR PROTECTION[/I]'; use Net::Telnet(); my $telnet = new Net::Telnet ( Timeout=>40,Errmode=>'die'); $telnet->open($hostname); $telnet->waitfor('/Password: $/i'); print ("printing password"); $telnet->print($password); $telnet->waitfor('/Router> $/i'); print ("getting admin rights"); $telnet->print('en'); $telnet->waitfor('/Password: $/i'); $telnet->print($password); print ("printing password"); $telnet->waitfor('/Router#: $/i');
o load "Net::Telne t"?) at h.pl line 9.
pls help me to rectify the problem
Comment