I'm having trouble opening a text file in the script below. It works fine on AIX Unix but I can't seem to get the syntax right to open a file on IIS. It just says "can't open file". The script and txt files are both in the cgi-bin directory relative to the root web. Do I have to put the entire path in back to C:\ or can it be relative to the root web?
#!d:\perl
use CGI qw(:standard);
$ip= param("IPNum");
print "Content-type:text/html\n\n";
print <<WEB_PAGE;
<html>
<title>DLS Peers</title>
<body>
<h1>DLS Peer Information</h1>
<table border=1 width=40%>
<tr><th>Peers</th></tr>
</table>
WEB_PAGE
# IP number is now passed to this script via the dslentry.htm form
#print ("DLS Peer Table");
#print ("Enter Circuitless IP #\t");
#$ip=<STDIN>;
#chop ($ip);
print "<h3>IP number is $ip</h3>";
# Split the IP # and get the third octet
@octet=split(/\./,$ip);
# print ("The third octet = $octet[2]");
$trd = $octet[2];
print "<h3>The 3rd Octet is $trd</h3>";
# Build csv Array
# Open the dls txt file and search for the 3rd octet
$dir = "/cgi-bin/dls.txt";
open(PEERS, $dir) or print "Can't open File";
@peers = <PEERS>;
print "<h3>Peers Below</h3>";
print @peers;
@csv = (grep /^$trd/, @peers) or die "No such IP";
@ncsv = split(/,/, $csv[0]);
jdporter - added code tags