From: Caio Chassot Date: 2006-09-20T10:13:06+09:00 Subject: Re: piping input when shelling out On 2006-09-19, at 22:05 , Paul Lutus wrote: > output = `echo #{s} | perl -pe "s/a/x/g"` > > I want to emphasize there are a dozen ways to do this. This one > happens to > be simple to understand. Another way is File.popen(), but that > approach > makes bidirectional communications difficult. I thought about doing it with echo but then I'd have to escape the string, and what if I was dealing with binary data, and all that... so popen looks like a more robust solution.