in reply to Re^4: What to test in a new module
in thread What to test in a new module

the brackets do make it more visually distinct and perhaps that's your point.

That is precisely my point.

It isn't obvious that return; returns undef, so I don't depend on that. That is, I don't use that construction when that's what I want to do.

Replies are listed 'Best First'.
Re^6: What to test in a new module
by choroba (Cardinal) on Jul 11, 2023 at 18:22 UTC
    > It isn't obvious that return; returns undef

    It doesn't. It returns undef in a scalar context, but an empty list in a list context.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Whatever. It returns the same as return();
      The point is that what it returns isn't obvious — at least, not nearly as obvious as return(); ... so it's worth the extra two characters (imho).