On Wednesday 16 July 2008 19:54:57 James Keenan via RT wrote: > This module is written in Perl 5 and is called in a program written in > Perl 5. In the work I've done in this project, I've taken the approach > to return values which I think is more Perlish, namely, if a subroutine > completes and does what you wanted it to, it should return a true value.
I don't consider that particularly Perlish; I prefer to throw exceptions on failure instead of adding an "Everything's Okay!" alarm to my code. Yet I only bring this up because it's not a practice I've seen consistently applied throughout our Perl 5 code. If it's a practice that enough committers want apply to our code, that's fine and I have no strong preference either way -- but it's news to me. > A bare return returns an undef, which in Perl is false. That's not exactly true. Sometimes it returns an empty list. > Having these subs end in a bare return to me connotes an unsatisfactory > outcome of some sort. Me too, but for a different reason -- it's vestigial magical useless copy-and-paste non-functional code added to satisfy a poorly implemented Perl::Critic policy. We should be removing code that doesn't do anything useful instead of adding more of it. -- c