hmm.... ok, I ran into another problem... your code worked.... but now I cant print contents from the file...
Im using the following code:
$dir = "/home/htdocs/eqguardians/wanderinglords/char";
opendir(DIR,$dir);
@files=
sort
grep { -f"$dir/$_"}
readdir (DIR);
closedir (DIR);
foreach $file (@files)
{
$file=~m,.*\.(.*),;
$extention="$1";
if($extention eq "txt"

{
open(data, "<$dir/$file"

;
while(<data>){
#OPEN FILE AND PARSE
#print "$file";
chomp($rec);
($inval,$server,$name,$status1,$level,$race,$class,$zone,$locx,$locy,$locz)=split(/\|/,$rec);
if ($status1 ne 'Offline'){
print "<tr height='2'><td><font size='2'>$server</font></td><td><font size='2'>$name</font></td><td><font size='2'>$level</font></td><td><font size='2'>$race</font></td><td><font size='2'>$class</font></td><td><font size='2'>$zone</font></td><td><font size='2'>$locx</font></td><td><font size='2'>$locy</font></td><td><font size='2'>$locz</font></td></tr>\n";
}
}
close(data);
}
}
(the reason the #print "$file"; is there is because thats how I tested to see if your part of the script was working... which it did, since it prited the names of all the files)
any idea why this wouldnt work? I know its somewhere in this part of the code...
chomp($rec);
($inval,$server,$name,$status1,$level,$race,$class,$zone,$locx,$locy,$locz)=split(/\|/,$rec);
if ($status1 ne 'Offline'){
print "<tr height='2'><td><font size='2'>$server</font></td><td><font size='2'>$name</font></td><td><font size='2'>$level</font></td><td><font size='2'>$race</font></td><td><font size='2'>$class</font></td><td><font size='2'>$zone</font></td><td><font size='2'>$locx</font></td><td><font size='2'>$locy</font></td><td><font size='2'>$locz</font></td></tr>\n";
}
}