Subject: | ErrorHandling::RequireCheckingReturnValueOfEval not allowing "return eval ..." |
ErrorHandling::RequireCheckingReturnValueOfEval complains when you do
something like this:
sub foo {
return eval { 42 };
}
Probably just an oversight in the policy.
Test::Builder does this sort of thing in is_fh()...
sub is_fh {
my $self = shift;
my $maybe_fh = shift;
return 0 unless defined $maybe_fh;
return 1 if ref $maybe_fh eq 'GLOB'; # its a glob ref
return 1 if ref \$maybe_fh eq 'GLOB'; # its a glob
return eval { $maybe_fh->isa("IO::Handle") } ||
# 5.5.4's tied() and can() doesn't like getting undef
eval { (tied($maybe_fh) || '')->can('TIEHANDLE') };
}