4 use Test::More 'no_plan';
6 use constant NO_SUCH_FILE => "this_file_had_better_not_exist";
10 eval { open(my $fh, '<', NO_SUCH_FILE); };
11 ok($@, "3-arg opening non-existent file fails");
12 like($@, qr/for reading/, "Well-formatted 3-arg open failure");
14 eval { open(my $fh, "< ".NO_SUCH_FILE) };
15 ok($@, "2-arg opening non-existent file fails");
17 like($@, qr/for reading/, "Well-formatted 2-arg open failure");
18 unlike($@, qr/GLOB\(0x/, "No ugly globs in 2-arg open messsage");