Help for this page

Select Code to Download


  1. or download this
    my $tn = Net::Telnet->new();
    # setup your connection here...
    ...
    $tn->print("some command goes here ; echo $tag");
    my($pre,$match) = $tn->waitfor( String => $tag );
    my @output = split(/\r?\n/,$match);
    
  2. or download this
    my $prompt = "___NET_TELNET_PROMPT_DETECTOR___".time();
    $tn->cmd("export PS1=$prompt");
    $tn->prompt("$prompt");