On Sep 23, Manish Sapariya said:

I want to have pure perl equivalent of following:

my $out = `my_utility | grep manish`;

which will give me the lines containing manish in the output
of my_utility in variable $out.

You'd use the aptly-named grep() function in Perl to get only those elements returned by `my_utility` that have 'manish' in them:

  my @wanted = grep /manish/, `my_utility`;

--
Jeff "japhy" Pinyan        %  How can we ever be the sold short or
RPI Acacia Brother #734    %  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to