hi monks

i need to know whether IPC::Run can be used to spawn a telnet session and send some commands to it and display their output

i came across Net::Telnet and used it. it works.

but i need to know whether thi implentation is possible through IPC::Run

below is my code

#!/usr/bin/perl use IPC::Run qw(start pump finish timeout) ; my $server_address ='192.168.166.100'; my @cat = qw(cmd.exe); my $user_name = 'anitha'; #my @cat = qw(cmd /k telnet $server_address); my $h =start(\@cat, \$in , \$out); #pump $h while $out=~/.*>/i; $in .="telnet 192.168.166.100"."\n"; pump $h until $out=~/login:/i; $in .=$user_name."\n"; pump $h while $out=~/password .* /i; "before passwd\n"; $in .="9888888"."\n"; pump $h while $out=~/[.*]$/; $in .="help"."\n"; pump $h while $out=~/[.*]$/; print "$out\n";

so while executing its waiting indefinitely, pl help me out in this regard. tell ur valuable guidelines.... thanks

In reply to ipc :: run & telnet by perlseeker19

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.