Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Perl-Critic CPAN distribution.

Report information
The Basics
Id: 38629
Status: new
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



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') }; }