opendir DIR, "$confdir/"; my @files = grep { $_ ne '.' && $_ ne '..' && } readdir DIR; closedir DIR; unless (grep{$_ eq $urlist} @files) { die "You requested a page that does not exist. You might find what you're looking for by starting at site home of http://host.dom/index.pl?page=home\n"; }