I am writing a perl script and have hit a roadblock on my way. I am relatively new to perl. i have a command which is a combination of many commands joined by pipes. it basically looks for a particular id in a huge file. when i run the command on the command line it works perfectly fine but when i put it in the script, it cats the whole file instead of just the id that i need. I have used backtics, exec, system... nothing seems to work. Any help will be greately appriciated. i am just not able to over come this. just to have a clear idea here s the code snippet: grep 'DataDictionary' $file | awk -F'<pciOFACViolation>' '{print $1}' | awk '{print $3}' | awk -F'>' '{print $1}'..... $file is the file to be searched.

In reply to commands with multiple pipes in perl by raghu_shekar

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.