Re: Can't close filehandle

2013-05-01 Thread Manfred Lotz
On Wed, 1 May 2013 14:57:34 -0700 Charles DeRykus wrote: > On Wed, May 1, 2013 at 12:57 PM, Manfred Lotz > wrote: > > > On Wed, 1 May 2013 12:00:18 -0700 > > Charles DeRykus wrote: > > > > > > ... > > > > Thanks for your detailed explanations. I think that close should > > > > work as I cannot

Re: Can't close filehandle

2013-05-01 Thread Charles DeRykus
On Wed, May 1, 2013 at 12:57 PM, Manfred Lotz wrote: > On Wed, 1 May 2013 12:00:18 -0700 > Charles DeRykus wrote: > > > > ... > > > Thanks for your detailed explanations. I think that close should > > > work as I cannot see any reason why a failure of a command closes > > > the pipe prematurely.

Re: Can't close filehandle

2013-05-01 Thread Manfred Lotz
On Wed, 1 May 2013 12:00:18 -0700 Charles DeRykus wrote: > > ... > > Thanks for your detailed explanations. I think that close should > > work as I cannot see any reason why a failure of a command closes > > the pipe prematurely. > > Actually, everything is ok until the close which checks both

Re: Can't close filehandle

2013-05-01 Thread Charles DeRykus
> ... > Thanks for your detailed explanations. I think that close should work > as I cannot see any reason why a failure of a command closes the pipe > prematurely. Actually, everything is ok until the close which checks both the status from reaping the child and the close itself: The open can a

Re: loop with additive matches

2013-05-01 Thread Jim Gibson
On May 1, 2013, at 11:27 AM, Noah wrote: > Hi there, > > I want to figure out a way to create a loop that will do actions based on > matches it collects in the loop and continue to do actions on all matches > till these are not m > > Hope this pseudo code makes sense: Not quite (see below).

loop with additive matches

2013-05-01 Thread Noah
Hi there, I want to figure out a way to create a loop that will do actions based on matches it collects in the loop and continue to do actions on all matches till these are not m Hope this pseudo code makes sense: 1) start loop 2) find all matches 3) end loop 4) start loop 5) do some action

Re: Can't close filehandle

2013-05-01 Thread Manfred Lotz
On Wed, 1 May 2013 11:50:05 -0400 Brandon McCaig wrote: > On Wed, May 01, 2013 at 11:45:00AM -0400, Brandon McCaig wrote: > > One thing that I know bit me with the 'or die' pattern is that > > with a pipe if the child process exits with an non-zero exit > > status then close returns undef, ... >

Re: Can't close filehandle

2013-05-01 Thread Andy Bach
On Wed, May 1, 2013 at 10:45 AM, Brandon McCaig wrote: > One thing that I know bit me with the 'or die' pattern is that > with a pipe if the child process exits with an non-zero exit > status then close returns undef, even though there is really no > problem "closing the pipe". > Wow - thanks!

Re: Can't close filehandle

2013-05-01 Thread Brandon McCaig
On Wed, May 01, 2013 at 11:45:00AM -0400, Brandon McCaig wrote: > One thing that I know bit me with the 'or die' pattern is that > with a pipe if the child process exits with an non-zero exit > status then close returns undef, ... Sorry, close returns false to signal failure, not undef. > close

Re: Can't close filehandle

2013-05-01 Thread Manfred Lotz
On Wed, 1 May 2013 10:04:15 -0500 Andy Bach wrote: > On Wed, May 1, 2013 at 9:22 AM, Manfred Lotz > wrote: > > > have a script where I log stuff to a file and the same time displays > > it to stdout using Log4perl. > > > > If you use the autodie perldoc example code: > eval { >

Re: Can't close filehandle

2013-05-01 Thread Brandon McCaig
On Wed, May 01, 2013 at 04:22:42PM +0200, Manfred Lotz wrote: > Hi there, Hello, > I have a script where I log stuff to a file and the same time displays > it to stdout using Log4perl. > > Here is a minimal example where I log a command which fails. > >

Re: Can't close filehandle

2013-05-01 Thread Manfred Lotz
On Wed, 1 May 2013 07:58:38 -0700 "Ron Bergin" wrote: > Manfred Lotz wrote: > > Hi there, > > I have a script where I log stuff to a file and the same time > > displays it to stdout using Log4perl. > > > > Here is a minimal example where I log a command which fails. > > > >

Re: Can't close filehandle

2013-05-01 Thread Andy Bach
On Wed, May 1, 2013 at 9:22 AM, Manfred Lotz wrote: > have a script where I log stuff to a file and the same time displays > it to stdout using Log4perl. > If you use the autodie perldoc example code: eval { close($fh); }; > if ($@ and $@->isa('

Re: Can't close filehandle

2013-05-01 Thread Ron Bergin
Manfred Lotz wrote: > Hi there, > I have a script where I log stuff to a file and the same time displays > it to stdout using Log4perl. > > Here is a minimal example where I log a command which fails. > > > #! /usr/bin/perl > > use strict; > use w

Can't close filehandle

2013-05-01 Thread Manfred Lotz
Hi there, I have a script where I log stuff to a file and the same time displays it to stdout using Log4perl. Here is a minimal example where I log a command which fails. #! /usr/bin/perl use strict; use warnings; #use autodie; use Log::Log4pe