But how can i redirect only those values to the output file??

Your scalar variable $output is just like any other variable. You can manipulate and modify it in any way you choose before printing it to the output file. If this actual modification is the part you are having trouble with, then for now ignore performing input and output and just work on that. Post an SSCCE if you still have trouble and maybe take a read through How to ask better questions using Test::More and sample data to help others understand what it is you want to achieve. eg:

use strict; use warnings; use Test::More tests => 1; my $have = '_id:ci2784'; my $want = 'ci2784'; # ... some code here which modifies $have is ($have, $want);

Good luck!


In reply to Re: Redirect a substring/desired values from a System output to a file in Perl by hippo
in thread Redirect a substring/desired values from a System output to a file in Perl by Murali_Newbee

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.