Guest_imported
New member
- Jan 1, 1970
- 0
Program:
#!/usr/local/bin/perl
$abso_path = "f:/inetpub/clanworld.org/clans/loros/cgi-bin/gamers";
print "content-type: text/html\n\n";
my $in;
if ($ENV{'REQUEST_METHOD'} eq "GET"
{
$in = $ENV{'QUERY_STRING'};
} else {
$in = <STDIN>;
}
$in =~ s/\+/ /gi;
$in =~ s/%(..)/pack("c",hex($1))/ge;
opendir(DIR,"$abso_path/data"
|| die("failed to open dir: $!"
;
while($var = readdir(DIR))
{
print "$var<br>";
@files = split (/.dat/, $var);
}
closedir(DIR);
for($i =0; $i <= $#files; $i++)
{
print "$files[$i]<br>";
}
<===== EOF =====>
output:
.
..
adminsecurityfile.dat
banlist.dat
index.dat
lastusr.dat
reguser
reguser
problem:
it doesn't printout the inital read (...adminsecurity.datbanlist.datindex.datlastusr.datreguser)
and it doesn't split out the .dat's from the file names.
can anyone enlighten me as to where i'm going wrong?
thanks
#!/usr/local/bin/perl
$abso_path = "f:/inetpub/clanworld.org/clans/loros/cgi-bin/gamers";
print "content-type: text/html\n\n";
my $in;
if ($ENV{'REQUEST_METHOD'} eq "GET"

$in = $ENV{'QUERY_STRING'};
} else {
$in = <STDIN>;
}
$in =~ s/\+/ /gi;
$in =~ s/%(..)/pack("c",hex($1))/ge;
opendir(DIR,"$abso_path/data"


while($var = readdir(DIR))
{
print "$var<br>";
@files = split (/.dat/, $var);
}
closedir(DIR);
for($i =0; $i <= $#files; $i++)
{
print "$files[$i]<br>";
}
<===== EOF =====>
output:
.
..
adminsecurityfile.dat
banlist.dat
index.dat
lastusr.dat
reguser
reguser
problem:
it doesn't printout the inital read (...adminsecurity.datbanlist.datindex.datlastusr.datreguser)
and it doesn't split out the .dat's from the file names.
can anyone enlighten me as to where i'm going wrong?
thanks