in reply to IIS 5.0 perl problem

What does the following output:
print "Content-type: text/html\015\012\015\012"; print "<p>start</p>\n""; my $rv = `dir `; if (defined($rv)) { print $rv; } else { print "<p>[$!,$?]</p>\n"; } print "<p>end</p>\n";

Replies are listed 'Best First'.
Re^2: IIS 5.0 perl problem
by Anonymous Monk on Aug 22, 2009 at 02:50 UTC
    Prints: Bad file descriptor,-1 @Sandy: IIS is Internet Information Server, web server that is built into Windows XP. I should have mentioned, the sample script works fine off the command line. It also works fine when executed through any other web server. It's only when ran through IIS that it doesn't work properly. Mickysoft is doing something that disables CLI execution.

      hum, not very useful. I don't know what the problem could be, but it has nothing to do with Perl.

      Shelling out to use dir is pretty silly, so you could kill two birds with one stone by avoiding it. See readdir.