https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19809

--- Comment #18 from Marcel de Rooy <m.de.r...@rijksmuseum.nl> ---
(In reply to Julian Maurice from comment #17)
> I don't know if it's perlish or not. To me it just feels natural to always
> get a value (even if that value is undef) when I call find. And when you
> think about it, that's what we get actually by being forced to put scalar in
> front of `find` calls.

https://metacpan.org/pod/Perl::Critic::Policy::Subroutines::ProhibitExplicitReturnUndef
Inspired by Damian's best practices.

Note that my $object; ... return $object; is almost the same.

But this is not an argument to not allow an exception from the rule ;)
The only thing we should not do is:
@array = Koha::Objects->find($x);
if( @array ) {
etc.
Because that condition would always be true. Similarly, foreach( ..->find )
would not work.

if( Koha::Objects->find($x) ) would be just fine however and probably what we
need most.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to