On 1/14/2015 3:11 PM, Mark Martinec wrote:
Yep that was done to pass the XT tests for a release.  Joe can you
look at those returns again?

That advice from perlcritic needs to be taken with a large grain of salt.
In the past I have been bitten by this several times. It is generally
safer to leave 'return undef' unless one carefully analyzes in what
context a subroutine is being called. I'd suggest to revert that
changeset entirely.
  Mark


If a subroutine is supposed to return exactly one scalar
and is using a return, that return must be a 'return undef'.

Consider the surprising behaviour:

perl -le '
  sub foo {$a=shift; return if !$a; sin($a)};
  ($x, $y, $z) = (foo(3), foo(0), 9);
  print "x=$x, y=$y, z=$z"'

x=0.141120008059867, y=9, z=

:-) Well I don't want to change the vetting process for a release and xt/60_perlcritic.t has been used for years on the code base. Suggestions what we can do to resolve the issue that also passes that test so we don't have to go down that rabbithole?

Regards,
KAM

Reply via email to