Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: system, pipes, shell, quoting

by IlyaM (Parson)
on Nov 13, 2002 at 08:06 UTC ( #212521=note: print w/ replies, xml ) Need Help??


in reply to system, pipes, shell, quoting

Simpliest solution: break dependacy on shell. Just don't use it: replace system with IPC::Run and you don't need to call shell to pipe output from one program to another anymore.

use IPC::Run qw(run); run([$program1, $file1], '|', [$program2, '-x', '-y'], '|', [$program3], ">$file2", '2>/dev/null') or die "Error: $?";

--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org


Comment on Re: system, pipes, shell, quoting
Download Code
Re: Re: system, pipes, shell, quoting
by superpete (Beadle) on Nov 13, 2002 at 08:29 UTC
    ooooh :-)

    This is exactly was I was looking for, thanks very much!

    Does IPC::Run "come with perl" ?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://212521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2014-08-29 17:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (283 votes), past polls