in reply to commands with multiple pipes in perl

Please show us what you've tried, and tell us in which way it doesn't work.

You have to be careful which variables you interpolate, and which you don't:

my $file = 'stuff'; system qq[grep 'DataDictionary' $file | awk -F'<pciOFACViolation>' '{p +rint \$1}'|...]; # ^ interpolate + ^ don't interpolate

Update: see a similar discussion we have at the moment.

Replies are listed 'Best First'.
Re^2: commands with multiple pipes in perl
by raghu_shekar (Novice) on Mar 17, 2009 at 07:25 UTC
    the code that i have shown is the exact one that i am trying.. it works perfectly fine when i execute from the command line but when i put in the script it just cats the file and displays the which i am storing in an array.
      the code that i have shown is the exact one that i am trying..

      You can't just execute shell code in perl as if perl were the shell. You need something like system. So show us the perl code you've tried. And try the example I wrote.

      and displays the which i am storing in an array.

      This sentence makes no sense to me.

      A reply falls below the community's threshold of quality. You may see it by logging in.