On Wed, 11 Oct 2006 15:51:38 -0700 (PDT), [EMAIL PROTECTED] (Phil Crow) wrote:
>I've done a bit more digging. It turns out the problem only occurs for shared >JVM (which I don't think I need). But the problem is not in Inline::Java at >all. Here is a simple script to demonstrate the problem which lies in either >Perl's open function of in IPC::Open3's open3 method. > >#!/usr/bin/perl > >use IPC::Open3; >use IO::File; > ># This one works fine: ># my $pid = open3( '<&STDIN', '>&STDOUT', '>&STDERR', 'ls' ); ># warn "$pid\n"; > ># This one does not. >my $dev_null = '/dev/null'; > >my $out = new IO::File( ">/dev/null" ); >if ( not defined $out ) { > die "couldn't open $dn for writing\n"; >} > >my $pid = open3( '<&STDIN', $out, '>&STDERR', 'ls' ); > >Running this results in: >open3: open(GLOB(0x180b0cc), >&=4) failed: Bad file descriptor at ./open3test >line 17 > >I even poked inside IPC::Open3 and wrote to the handle whose descriptor is 4 >without problem. > >Whom should I tell of this apparent bug? > >Phil > >p.s. For completeness, here is perl -V: >Summary of my perl5 (revision 5 version 8 subversion 6) configuration: I'm not an inline expert, but I use IPC::Open3 quite often, so this caught my attention. I tried running your script with Perl 5.8.8 and there was NO error. I'm running linux. Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Maybe you need to upgrade? -- I'm not really a human, but I play one on earth. http://zentara.net/japh.html