How would I go about modifying the output of a program I've called with back ticks..

For example, I am calling telnet from my script, but the boss doesn't want users to see the ip that telnet is calling (It displays Trying 192.168.1.101... when you run telnet).

I would use Net::Telnet if there wasn't a need to have control of the terminal, but anyways.

I've searched all over, all I can find is how to capture STDOUT from telnet, save it to a file, variable, etc... However, I see nothing on how I could modify STDOUT, and print it back to the terminal, and move on happily. I've tried a few different things, but I think I'm confused, can this be done? I know I can modify STDOUT when saved in an @array using s/// to remove the ip, but I just can't seem to send it back to the Terminal smoothly without loosing control of telnet. Maybe stop the flush out the output via the shell(stty)??

Make any sense?

Thanks in advance!


In reply to Modifying STDOUT and keeping control by Anonymous Monk

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.