>>
>>
>>Hi,
>>
>> >I need to telnet some hosts automatically without supplying password.
>> >I can do it with Expect but I hardly know the language.
>> >I wonder what you think of the Perl module Expect - if it's any good and
>> >easy to use.
>> >Also if you can think of another way to do the job this will also be
>>great.
I've used expect before- i don't have the script with me :/
I'll try to dig it up...
Also, using Net::Telnet can work... it's a little more complex,
but feels more like Perl :) well, it /is/ Perl... *laugh*
if you use expect then here is one way to do it :
open (IN, "$expect_script |");#pipe the output of the expect script
#to a filehandle
while (<IN>){
manipulate data
}
you can't do much to manipulate the expect script here, but it lets you grab
the results.
If you want a Perlish way to login outomatically, look at the Perl expect
module (i haven't - and i understand it's a bit complicated) or look at
Net::Telnet. I recommend the latter. It may be complex, but the
documentation is fairly complete. It will take practice getting used to it.
regards,
willy
http://www.hackswell.com/corenth
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>