use Data::Dumper; print "Trying to open file this file: ", Dumper($file); open my $f, '<', $file or die ...;