Created
February 26, 2018 18:59
-
-
Save jef-sure/8d3487e8a84fe795ca6458b6e6f51222 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Undef; | |
| sub new { bless \my $a, $_[0] } | |
| sub AUTOLOAD { Undef->new } | |
| use overload | |
| '""' => sub {""}, | |
| lt => sub { $_[2] ? $_[1] lt "" : "" lt $_[1] }, | |
| le => sub { $_[2] ? $_[1] le "" : "" le $_[1] }, | |
| gt => sub { $_[2] ? $_[1] gt "" : "" gt $_[1] }, | |
| ge => sub { $_[2] ? $_[1] ge "" : "" ge $_[1] }, | |
| eq => sub { "" eq $_[1] }, | |
| ne => sub { "" ne $_[1] }, | |
| bool => sub { 0 == 1 }, | |
| '0+' => sub {undef}; | |
| 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment