Well you could do something like this:
#!/usr/bin/perl/
print "Content-type: html/textnn";
$filespath = "c:/program files/apache group/apache/htdocs/review/";
opendir(DIR, "$filespath") or die "Couldn't open directory";
@directory = readdir(DIR);
closedir(DIR);
@files = grep(/.txt/, @directory);
foreach $eachfile(@files) {
chomp($eachfile);
open(FILE,"$filespath/$eachfile");
@filedata =
;
close(FILE);
@file = split(/|/, $filedata[0]);
$file = "$file[0]|$file[5]|$file[2]|$eachfile|n";
push(@agianfiles,$file);
}
print <My files
File Name: | Data 1: | Data 2: | Data 3: |
topHTML
foreach $file(@agianfiles) {
chomp($file);
@eachdata = split(/|/, $file);
print qq~$eachdata[3] | $eachdata[0] | $eachdata[1] | $eachdata[2] |
~;
}
print <
botHTML
########
That opens a directory, gets all the .txt files, then opens them individualy gets out some feilds and pushes them into an array. Now we run the array with all the data through a loop to print it out.
------------------
ZCom Bulletin Boards - Open Source Bulletin Boards