in reply to A file in a directory

In general, please always define "it's not working" with the error message..

Your grep arguments are backwards:
@files = grep { /\errors.txt$/ && -f $_ }, @files;
Related topics: glob, File::Find, File::Find::Rule (example below)
my @files = File::Find::Rule->file()->name('errors.txt')->maxdepth(1)- +>in($dir);
Also, if you're going for just one specific file, no need to read the directory -- just check directly if the file exists:
my $file = $dir . '/errors.txt'; push @files, $file if -f $file;

Replies are listed 'Best First'.
Re^2: A file in a directory
by Anonymous Monk on Apr 24, 2006 at 19:26 UTC
    Sure, I just needed to go specifically to the file, thanks!