in reply to Search a directory for files

can you just check for the file's existence with -f (see -X)
my ($file1, $file2) = ("$path/database.txt", "$path/keywords_database. +txt"); -f $file1 or do { # build $file1 here }; -f $file2 or do { # build $file2 here };