Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^3: IPC::Cmd pipe array

by runrig (Abbot)
on Oct 29, 2013 at 16:54 UTC ( #1060178=note: print w/replies, xml ) Need Help??

in reply to Re^2: IPC::Cmd pipe array
in thread IPC::Cmd pipe array

My code is using IPC::Run, not IPC::Cmd. Your's is still using IPC::Cmd.

Replies are listed 'Best First'.
Re^4: IPC::Cmd pipe array
by ag4ve (Monk) on Oct 29, 2013 at 17:13 UTC
    Ah, you're right. I'll look at converting (will probably be good since there's more written about IPC::Run anyway). Thanks
Re^4: IPC::Cmd pipe array
by ag4ve (Monk) on Oct 31, 2013 at 15:53 UTC
    #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; use IPC::Run qw/run/; use IPC::Run qw(run); my @in = ("Test foo", "Test bar"); run [echo => -n => @in] , '|', [ sed => "s/(foo|bar)/pass/" ], '>', \m +y $out; print "Redir: " . Dumper($out);


    % ./ Redir: $VAR1 = 'Test foo Test bar';

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1060178]
[thepkd]: Yes this is my first time in cb. Trying to work my way around.
[JohnCub]: "A ref too far" would make a good title for anyone's perl memoirs
[thepkd]: Anyways it works with $aohoaoh[0]->{'foo '}[0]->{'bar'}
[GotToBTru]: "I did it my $way"
[JohnCub]: I hope $way isn't a hashref. ;)
[GotToBTru]: many times i've been told I made a real hash of thiings
[GotToBTru]: so .. perhaps it should b e

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2016-12-06 13:48 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (105 votes). Check out past polls.