Re: How to test Output when using IPC::Open3

2010-08-31 Thread C.DeRykus
On Aug 29, 10:46 pm, ole...@gmail.com (marcos rebelo) wrote: > We are out of contest in here. > > I know how to run open3, but I don't know how to test it. Repeating > Hm, I just wanted to warn you that Open3 may easily require more paranoia than you've shown... your sample is simple enough to es

Re: How to test Output when using IPC::Open3

2010-08-29 Thread marcos rebelo
We are out of contest in here. I know how to run open3, but I don't know how to test it. Repeating use strict; use warnings; use IPC::Open3; use IO::Handle; use Test::More; use Test::Trap; sub shell_run { my ($stdin, $stdout, $stderr) = map {IO::Handle->new} (0..2); print ""; open

Re: How to test Output when using IPC::Open3

2010-08-29 Thread C.DeRykus
On Aug 28, 10:42 pm, ole...@gmail.com (marcos rebelo) wrote: > the idea is to process the STDOUT ad the STDERR. > > open don't do it > I was afraid you'd say that... open3 is very liable to deadlock since you're trying to read from both stderr and stdout. You'll very likely want to use IO::Selec

Re: How to test Output when using IPC::Open3

2010-08-28 Thread marcos rebelo
the idea is to process the STDOUT ad the STDERR. open don't do it Best Regards Marcos Rebelo On Sun, Aug 29, 2010 at 6:08 AM, John W. Krahn wrote: > C.DeRykus wrote: >> >> Since you mention simplifying the code, do you actually >> need IPC::Open3 ?  In your sample code, you're only >> reading p

Re: How to test Output when using IPC::Open3

2010-08-28 Thread John W. Krahn
C.DeRykus wrote: Since you mention simplifying the code, do you actually need IPC::Open3 ? In your sample code, you're only reading process output. If you don't need IPC::Open3 complexity, you could just use magic open to read output : sub shell_run { print ""; my $pid = open( m

Re: How to test Output when using IPC::Open3

2010-08-28 Thread C.DeRykus
On Aug 28, 12:45 am, ole...@gmail.com (marcos rebelo) wrote: > I'm having a more or less complicated code, that was simplified to this. > > use strict; > use warnings; > use IPC::Open3; > use IO::Handle; > use Test::More; > use Test::Trap; > > sub shell_run { >     my ($stdin, $stdout, $stderr) = m