Hey folks, I got my script working fine on a Linux / Apache platform, but now the person I wrote this for can't seem to get the script working on an IIS 4.0 server. Their IIS server has a cgi-bin which runs some Perl stuff right now, which is why I'm a little baffled to say the least. So I guess my question to you is...is there any reason why this CGI script wouldn't work on an NT platform? I double checked all the functions I used and they're all NT compliant...sooooo I don't think it's my script.

See the working script here: http://www.triggerland.com/cgi-bin/Perl/rand.cgi

See the same script fail here: http://www.building2.net/cgi-bin/rand.cgi


Here's the script:

#!/usr/bin/perl
#############################################
# This script displays 3 distinctly different random images, which are read from a specified directory.
# Author: Adam Sharp
# E-mail: [email protected]
# Date created: 01/02/2000
#############################################

## Enter the URL if the image directory here: ##
$url = "http://www.triggerland.com/testing/images/";

## Enter the relative directory of your images here: ##
opendir(DIR,"../../public_html/testing/images/");

## No more changes are needed ##

print "Content-type: text/html\n\n";

print "<html><body><center>";

@images = readdir(DIR);

$number1 = int(rand(@images));
$number2 = int(rand(@images));
$number3 = int(rand(@images));


until ( ( $number1 != 0 ) && ( $number1 != 1 ) )
{
$number1 = int(rand(@images));
}

print "<img src=$url$images[$number1]>";


until ( ($number2 != $number1) && ( $number2 != 0 ) && ( $number2 != 1 ) )
{
$number2 = int(rand(@images));
}
print "<img src=$url$images[$number2]>";


until ( ($number3 != $number2) && ($number3 != $number1) && ( $number3 != 0 ) && ($number3 != 1) )
{
$number3 = int(rand(@images));
}
print "<img src=$url$images[$number3]>";


print "</center></body></html>";

# END
#############################################

Thanks for any input guys. Is it a server setting that's wrong or something to that effect?

[This message has been edited by Housen Maratouk (edited January 03, 2001).]