in reply to Perl CGI on WinXP - Dos 'bad file descriptor'

Hi,
Try running the script from command line. If it runs perfect then there is something wrong with your configuration of the webserver.

Let us know the version of perl and the Webserver.
I have used windows XP earlier i had no such problem. Also try it without /t. Try using system command too.

Update: Try this. Its a guess that /t is assumed as something different
$cmd="cmd "."time"." "."/t"; $result=`$cmd`;
Thanks
SasiKumar

Replies are listed 'Best First'.
Re^2: Perl CGI on WinXP - Dos 'bad file descriptor'
by Madbreaks (Novice) on Apr 18, 2005 at 16:51 UTC
    The command runs fine from the command line. To clarify, ANY command I place between backticks fails with "Bad file descriptor". Here's a simple example:

    if(defined (my $temp = `cmd.exe /c date /t`)) {<br> print "TEMP = $temp\n";<br> } else {<br> die "Command failed: $!";<br> }</br>

    From the command line this script correctly outputs the date, when running via CGI I get the aformentioned "Bad file descriptor".

    IIS Version: 5.1
    Perl Version: This is perl, v5.8.0 built for MSWin32-x86-multi-thread

    Thanks again for your help with this!

    MB