http://www.perlmonks.org?node_id=753322


in reply to File not opening, but no error report

you could add the path using map
my $DIR = "./"; opendir ( my $dir, $DIR) or die "Can't open directory $DIR: $!\n"; my @files = map { $DIR.$_ } readdir( $dir ); closedir( $dir ); foreach my $file ( grep { -f $_ } @files ) { print "\$file is $file\n"; }