What did you do to test it? Were you expecting a failure? Are you sure that this test method actually produces a failure?
Of note, the call to open in the sub won't throw an error on its own. You need to check its return value:
open my $p, '<', $filename or return "Could not open $filename: $!";
Which should be compatible with the way you intended to catch errors. However, I'll also point out that or die "error message" tends to be the preferred way of doing this rather than or return "error message".
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.