$ perl -e 'open my $FOO, "<", "foo2.txt" or die "Could not open file foo2.txt : $!";' Could not open file foo2.txt : No such file or directory at -e line 1.