# New Ticket Created by [EMAIL PROTECTED] # Please include the string: [perl #37202] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=37202 >
#!/bin/perl use strict; use IPC::Open2; # # This fails under Win32 when input redirection is in effect, # for example "tstopen2.pl <NUL:" # my $child_pid = open2(\*CMD_OUT, \*CMD_IN, "ipconfig"); # When the above execute, you get this error: # open2: Can't call method "close" on an undefined value at # C:/Perl/lib/IPC/Open3.pm line 341. # # # On the other hand, this works: # # use IPC::Open3; # my $child_pid = open3(\*CMD_IN, \*CMD_OUT, \*CMD_ERR, "ipconfig"); -----Original Message----- From: Nicholas Clark [mailto:[EMAIL PROTECTED] On Behalf Of Nicholas Clark Sent: Saturday, September 17, 2005 6:11 PM To: Denton, Sam Subject: Re: IPC::Open3 failures On Sat, Sep 17, 2005 at 05:37:41PM -0400, [EMAIL PROTECTED] wrote: > I can consistently get this error: > > C:\tools\ECS>CDC_DMX_Hosts.pl -a reveal -h w2pf -s 40 0<NUL: > open2: Can't call method "close" on an undefined value at > D:/Perl/lib/IPC/Open3.pm line 341. > > Everything works OK if stdin isn't redirected, but it fails on all > re-directions. Adding a test for the value being defined fixes the problem, > but I'm unsure why the value isn't defined. Can you reduce this down to a small script that you can send to [EMAIL PROTECTED], the address for reporting core perl bugs to all the developers. Personally I have no Windows experience, and IPC::Open3 is very platform dependent, so I'm not able to help you further on this. Nicholas Clark