Tim Bunce
Thu, 07 Jan 2010 02:21:03 -0800
On Wed, Jan 06, 2010 at 04:08:17PM -0800, Jonathan Swartz wrote: > Thanks for your help...this bug has me feeling very isolated... > > >>Just about everything here is necessary to generate the bug. In > >>particular, I cannot generate the bug... > >>* If I move the code from connect.pl into the handler, even as a > >>string eval > >>* If I remove the "BEGIN" from connect.pl > >>* If I replace sendmail with another program > > > >That's the most interesting one to me. Try replacing it with a perl > >script that reports what open file descriptors have been inherited. > > Ok. What's the easiest way to do that? :) Sorry, probably dumb > question, but never did this before and scanning perlipc and > perlopentut and google didn't yield anything obvious.
I had to rummage around a bit, but this seems to work:
$ perl -e 'open(FH, ">&=$_") and printf "$_\n" for 0..100'
0
1
2
$ perl -e 'open(FH, ">&=$_") and printf "$_\n" for 0..100' 42<&1
0
1
2
42
(Using >&= or <&= doesn't seem to matter for this simple case.)
Tim.