You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Steve Hay <St...@uk.radan.com> on 2000/04/03 10:29:41 UTC

Re: Problem Compiling with Perl 5.6.0

> >     $status = system "D:\\WINNT\\system32\\ipconfig.exe >
> D:\\Temp\\ip.txt";
> >
> > then it carries on fine under Apache (now re-directing the output to the
> "ip.txt"
> > file), but under Apache+mod_perl the $status gets set to 256, the "ip.txt"
> file is
> > not created and I get the error
> >
> >     The handle could not be opened
> >     during redirection of handle 1.
> >
> > in error.log
> >
> > What is it that changed between Apache 1.3.6 (which doesn't have this
> problem) and
> > Apache 1.3.12 which causes this to happen, and can mod_perl be changed to
> cope
> > with it?
>
> Hi Steve,
>     I've tried this with the latest cvs mod_perl snapshot, like you
> use, with Perl 5.6.0 and Apache_1.3.12. I'm using Win98, with the
> 4DOS tools. As a cgi-bin script,
>      my $status = "ipconfig > C:\\test.txt"

[I take it you meant 'my $status = system "ipconfig > C:\\test.txt";' here?!]

>
> returns $status = 0, and C:\test.txt capturing the output.
> As an Apache::Registry script, the same thing returns
> a status of 256 (with a DOS window briefly opening and
> closing), but I get C:\test.txt still capturing the output. So it
> may have something to do with the different DOS "shells"?

Eh?  I don't believe the DOS "shell" changed between Apache 1.3.6 and Apache
1.3.12!!!!!!

The fact that you're running a different DOS "shell" to me does not explain the
problem: it only explains why your experience of the problem it slightly
different to mine.

It was changing from Apache 1.3.6 to Apache 1.3.12 which broke it -- my DOS
"shell" didn't change!

And did you get the line in the error.log?


Steve Hay



Re: Problem Compiling with Perl 5.6.0

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Mon, 3 Apr 2000, Steve Hay wrote:
> Randy Kobes <ra...@theoryx5.uwinnipeg.ca> wrote:
> > Steve Hay <St...@uk.radan.com> wrote:
> > > $status = system "D:\\WINNT\\system32\\ipconfig.exe > D:\\Temp\\ip.txt";
> > >
> > > then it carries on fine under Apache (now re-directing the output to the
> > "ip.txt"
> > > file), but under Apache+mod_perl the $status gets set to 256, the "ip.txt"
> > file is
> > > not created and I get the error
> > >
> > >     The handle could not be opened
> > >     during redirection of handle 1.
> > >
> > > in error.log
> > >
> >
> > Hi Steve,
> >     I've tried this with the latest cvs mod_perl snapshot, like you
> > use, with Perl 5.6.0 and Apache_1.3.12. I'm using Win98, with the
> > 4DOS tools. As a cgi-bin script,
> >      my $status = "ipconfig > C:\\test.txt"
> 
> [I take it you meant 'my $status = system "ipconfig > C:\\test.txt";' here?!]

Hi,
    Yes, I did mean that .....
> 
> >
> > returns $status = 0, and C:\test.txt capturing the output.
> > As an Apache::Registry script, the same thing returns
> > a status of 256 (with a DOS window briefly opening and
> > closing), but I get C:\test.txt still capturing the output. So it
> > may have something to do with the different DOS "shells"?
> 
> Eh?  I don't believe the DOS "shell" changed between Apache 1.3.6 and Apache
> 1.3.12!!!!!!

I didn't of course mean that the DOS "shell" changed between apache
versions, but the behaviour as far as interaction with
Perl/apache may have - from reading the README.win32 file in
the Perl sources, it's apparent that a perfectly legal
interaction with the shell under Unix can have quite
different outcomes under DOS, depending on what DOS "shell"
is used (Win95/98, NT, 4DOS tools, ....). As an example,
for the test suite for Perl 5.00503 on Win98, simply switching 
the "shell" from the standard one to 4DOS results in a significant
increase in the success rate of the tests passed, for the *same* 
compiled Perl binary.

> 
> The fact that you're running a different DOS "shell" to me does not explain the
> problem: it only explains why your experience of the problem it slightly
> different to mine.
> 
> It was changing from Apache 1.3.6 to Apache 1.3.12 which broke it -- my DOS
> "shell" didn't change!

But given the at times tenuous nature of Win32 system calls,
the newer Perl/mod_perl/Apache combination may
have changed the behaviour with the DOS shell - as I mentioned, the
4DOS "shell" for me managed to capture the output of this command to
an external file, albeit with a non-zero status. One moral perhaps
is that system calls like this are not as reliable under Win32
as they are in Unix.
 
> 
> And did you get the line in the error.log?

There weren't any errors logged, which is again perhaps an
indication of a touch of unreliability with system calls
under Win32.

> 
> 
> Steve Hay
> 
> 

best regards,
randy kobes