Re: run command from perl

2012-03-03 Thread Manfred Lotz
On 4 Mar 2012 05:03:55 - Peter Scott wrote: > On Fri, 02 Mar 2012 21:31:50 +0100, Manfred Lotz wrote: > > Another question I have: Where do I find what '-|' means? I mean the > > minus before the pipe char. > > perldoc -f open > > Thanks, found it there. -- Manfred -- To unsubscribe

Re: run command from perl

2012-03-03 Thread Peter Scott
On Fri, 02 Mar 2012 21:31:50 +0100, Manfred Lotz wrote: > Another question I have: Where do I find what '-|' means? I mean the > minus before the pipe char. perldoc -f open -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=

Re: run command from perl

2012-03-03 Thread John W. Krahn
Shlomi Fish wrote: On 2 Mar 2012 02:48:28 - Peter Scott wrote: It doesn't have flaws. You could do it without the module with a piped open: sub run_cmd { my $cmd = shift; open my $fh, '-|', "$cmd 2>&1" or die "open: $!"; print while<$fh>; close $fh; return $?>> 8; } I

Re: run command from perl

2012-03-03 Thread Shlomi Fish
Hi Peter, On 2 Mar 2012 02:48:28 - Peter Scott wrote: > On Sun, 26 Feb 2012 20:30:56 +0100, Manfred Lotz wrote: > > I want to run a shell command with the following constraints: > > > > a. I like to get the return code of the command b. Furthermore I want to > > combine stdout and stderr so

Re: run command from perl

2012-03-02 Thread Manfred Lotz
Hi Peter, Thanks for your reply. On 2 Mar 2012 02:48:28 - Peter Scott wrote: > > It doesn't have flaws. You could do it without the module with a > piped open: > > sub run_cmd > { > my $cmd = shift; > > open my $fh, '-|', "$cmd 2>&1" or die "open: $!"; > print while <$fh>; > clos

Re: run command from perl

2012-03-01 Thread Peter Scott
On Sun, 26 Feb 2012 20:30:56 +0100, Manfred Lotz wrote: > I want to run a shell command with the following constraints: > > a. I like to get the return code of the command b. Furthermore I want to > combine stdout and stderr so that the output comes in a natural sequence > like in the shell. c. I