Unknown-Values

 view release on metacpan or  search on metacpan

lib/Unknown/Values/Instance.pm  view on Meta::CPAN

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use overload @to_overload, '""' => 'to_string';
my $CORE_UNKNOWN = __PACKAGE__->new;
 
sub to_string {
    confess("Attempt to coerce unknown value to a string");
}
 
sub new {
    my $class   = shift;
    my $unknown = bless {} => $class;
    return $unknown;
}
 
# this helps to prevent some infinite loops
sub bool {$CORE_UNKNOWN}
 
sub compare {
 
    # this suppresses the "use of unitialized value in sort" warnings
    wantarray ? () : 0;



( run in 1.383 second using v1.01-cache-2.11-cpan-e5176c747c2 )