$| = 1; sub GenerateKeywordsDatabase { print "\nDate: ".localtime(time)."\n"; $kwords = $path."keywords_database.txt"; $temp = $path."temp.txt"; if (opendir (KWORDS, $path) && open(LIST, ">$kwords")) { print LIST "\n================================================================\n"; print LIST "\nDATE: ".localtime(time)."\n"; print LIST "\nNAME: ".$ENV{USERNAME}."\n"; print LIST "\n================================================================\n\n"; @kwds = sort grep {$_ ne '.' and $_ ne '..'} readdir(KWORDS); foreach(@kwds) { if($_ eq "database.txt") { print ("I can process $_, without calling GenerateTestFile!!!\n"); } elsif($_ ne "database.txt") { GenerateTestFileList(); if (open(DBASE, $path."database.txt")) { while() { chomp; open(TEMP, ">$temp") || die "cannot open [$temp], $!\n"; print TEMP "$_\n"; open(XFILE, $_) || die ("Cannot open [$_], $!\n"); while () { chomp; #if ($_ =~ /\|\<\/name\>/) #{ print (LIST "$_\n"); #} } } } else { die ("File does not exist, $!\n") } } } } else { die ("Could not open $path, $!\n"); } } 1;