On Friday 11 June 2004 07:50, Ramprasad A Padmanabhan wrote:
> Hi,
> I have written a web based utility that requires to login to several
> machines and do some routine tasks
> MY script uses Net::Telnet and works fine on most machines
> I use the the login() method to login to the servers
>
> The problem comes when the server sometimes has a different prompt
> password like
>
> login: ram
> Password for ram:
>
> Instead of just "password:" . I can get over this by using waitfor() and
> print() but the solution is patchy, because I have to write a seperate
> procedure for some hosts.
>
> Can I change login() or write my own generic login() that would work on
> all hosts
>
> Thanks
> Ram
Yes. You can write your own function to do the login.
RamsLogin {
waitfor(@_[0])
print(@_[1])
waitfor(@_[2]
print(@_[1])
}
More or less like what I wrote, you'll figure it out. Since I don't know how
the Net::Telnet package works that's the best I can do.
--
Linux
2.6.6
(Gentoo)
i686 P4
If wishes were horses, then beggars would be thieves.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>