Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

use boolean? #171

Open
dkulchenko opened this Issue · 4 comments

3 participants

@dkulchenko

Maybe include 'use boolean;' as one of the loaded modules?

Globally defines true() and false() so you can do:

if( thisworks() ) {
    runsomecode();
    return true;
}
@schwern
Owner

I used to do something like this. I'm dubious about its value. Mostly because it encourages return false; where most of the time you really want return;.

Working with Ingy (the author of boolean) it seems the value of boolean is mostly to provide a boolean object that something like YAML and JSON can serialize properly.

@doherty

Is it possible to add a warning for return false; and return undef;?

@schwern
Owner

I don't know about a warning, but a perlcritic policy would be easy.

However, there are plenty of times when you DO want to return false.

@doherty

I suggested a warning because you could (en|dis)able it lexically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.