Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,
I have wriiten progaram for connecting telnet server using Net::Telnet module.it is wroking fine with some system servers
but i am unable to connect to one of my windows telnet server because it is giving prompt :
You are about to send your password information to a remote computer in This might not be safe. Do you want to end anyway(y/n):

how to skipt prompt

Replies are listed 'Best First'.
Re: Facing problem with Telnet
by glide (Pilgrim) on Jan 11, 2008 at 09:38 UTC
    Hi,

    You can use the method waitfor, for example:

    my $pre_pass_prompt = q{Do \s you \s want \s to \s send \s anyway}; # save the current prompt my $current_prompt = $obj->prompt; # wait for the prompt $obj->waitfor(Match => m{$current_prompt}smx, Match => $pre_pass_prompt); # # check if the last prompt matched it's the $pre_pass_prompt if ($obj->last_prompt() =~ m{$pre_pass_prompt}smx) { # send the reply $obj->cmd(q{y}); }
    in many cases the login process have to be done using the waitfor, you can find more information about that in the Net::Telnet.
Re: Facing problem with Telnet
by BrowserUk (Patriarch) on Jan 11, 2008 at 06:42 UTC