in reply to Re^3: Recap: The Future of Perl 5
in thread Recap: The Future of Perl 5
Type::Tie does similar to your example tie code. And there's XS implementations for a lot of types in Type::Tiny::XS. I really should look at the possibility of implementing the tie stuff in XS too.
use Type::Tie; use Types::Common::Numeric qw(PositiveOrZeroInt); tie my $x, PositiveOrZeroInt;
Combining it with Attribute::Handlers could be a fun idea.
Also, you probably want to use [0-9] in your regular expression, not \d. Yes, there's a difference.
|
---|