The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Type::Tiny::NumEq - type constraint for single number equality

SYNOPSIS

    use Type::Tiny::NumEq;

    my $Foo = Type::Tiny::NumEq->new( value => 123 );
    $Foo->check(123); # true
    $Foo->check('123'); # true
    $Foo->check(124); # false

    Type::Tiny::Eq->new( value => undef ); # dies

DESCRIPTION

This package inherits from Type::Tiny; see that for most documentation. Major differences are listed below:

Attributes

value

Allowable value number. Non-number values (e.g. objects with overloading) will be stringified in the constructor.

LICENSE

Copyright (C) kobaken.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

kobaken <kfly@cpan.org>