|XP is just a number|
If your function normally returns scalars, then doing return; is likely the wrong thing to do. If your function at least sometimes returns lists, then return undef; is likely the wrong thing to do. The latter is covered by other replies.
The reason that the former is wrong is because it can break code like:
And the problems with return undef; don't really apply to functions that only ever return a scalar because you don't write code like:
So, unless Perl::Critic checks whether your function ever returns other than 1 scalar elsewhere, I consider this warning to be encouraging a bad practice (rather than just pushing a reasonable practice too hard as many people will find many of the possible warnings, surely).
In reply to Re^2: Module Announcement: Perl-Critic-1.01 (just a scalar)