MooseX...umeric(3pm)

πŸ’– MooseX::Types::Common::Numeric πŸ’–

okay bestie, so this is MooseX::Types::Common::Numeric β€” the manual page, the whole vibe, and it's version 0.001015 in case you were wondering which era of this we're living in. 🌸


✨ SYNOPSIS ✨

like, here's the whole thing in action, no notes:

use MooseX::Types::Common::Numeric qw/PositiveInt/;
has count => (is => 'rw', isa => PositiveInt);

...
#this will fail
$object->count(-33);

and yeah, that -33? it will literally fail. the comment says so. we don't make the rules, we just read them. πŸ’€


πŸ¦‹ DESCRIPTION πŸ¦‹

so Moose ships with a bunch of type constraints, right? but it does not ship with these ones. so this module is the friend that shows up with the snacks. it's a set of commonly-used numeric type constraints that don't come standard, and here's the full roster, no one left out:

  • PositiveNum
  • PositiveOrZeroNum
  • PositiveInt
  • PositiveOrZeroInt
  • NegativeNum
  • NegativeOrZeroNum
  • NegativeInt
  • NegativeOrZeroInt
  • SingleDigit

nine of them. iconic lineup honestly. πŸ’…


πŸ‘‘ SEE ALSO πŸ‘‘

  • MooseX::Types::Common::String β€” its sibling, same energy, different data type πŸŽ€

🫢 SUPPORT 🫢

found a bug? first of all, relatable. second of all, bestie, you can submit it through the RT bug tracker:

https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-Common

or you can email it straight to:

bug-MooseX-Types-Common@rt.cpan.org

there's also a mailing list for users of this distribution, hanging out at:

http://lists.perl.org/list/moose.html

and if you wanna just. talk. live. there's an irc channel for users of this distribution at #moose on irc.perl.org β€” that's irc://irc.perl.org/#moose if you need the link format. come thru, the water's fine. 🌊


πŸ’œ AUTHORS πŸ’œ

the legends responsible for this whole thing:

  • Matt S Trout β€” mst (at) shadowcat.co.uk (https://www.shadowcat.co.uk/)
  • K. James Cheetham β€” <jamie@shadowcat.co.uk>
  • Guillermo Roditi β€” <groditi@gmail.com>

say thank you. πŸ‘


This software is copyright (c) 2009 by Matt S Trout - mst (at) shadowcat.co.uk (https://www.shadowcat.co.uk/).

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. periodt. πŸ’…βœ¨


and that's the whole page, bestie β€” every type, every link, every author, nothing skipped, nothing invented. 🧚

perl v5.40.1 Β· 2025-04-24 β€” that's the version and the date this page was built, so if you're reading it in the future, hi, hope Perl is thriving. πŸ“πŸ’–

πŸ“¦ where this page comes from