Name : perl-Type-Tie
| |
Version : 0.015
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp156.1.1
| Date : 2024-07-03 19:17:49
|
Group : Development/Libraries/Perl
| Source RPM : perl-Type-Tie-0.015-lp156.1.1.src.rpm
|
Size : 0.06 MB
| |
Packager : https://www_suse_com/
| |
Summary : Tie a variable to a type constraint
|
Description :
This module exports a single function: \'ttie\'. \'ttie\' ties a variable to a type constraint, ensuring that whatever values stored in the variable will conform to the type constraint. If the type constraint has coercions, these will be used if necessary to ensure values assigned to the variable conform.
use Type::Tie; use Types::Standard qw( Int Num );
ttie my $count, Int->plus_coercions(Num, \'int $_\'), 0;
$count++; # ok $count = 2; # ok $count = 3.14159; # ok, coerced to 3 $count = \"Monkey!\"; # dies
While the examples in documentation (and the test suite) show type constraints from Types::Standard, but any type constraint objects supporting the Type::API interfaces should work. This includes:
* Moose::Meta::TypeConstraint / MooseX::Types
* Mouse::Meta::TypeConstraint / MouseX::Types
* Specio
* Type::Tiny
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-T/15.6/noarch |