PRANG::Coerce - Easily create subtypes and coercions for any type
use PRANG::Coerce; has_element 'an_array_of_strs' => is => 'rw', isa => 'PRANG::Coerce::ArrayRefOfStrs', coerce => 1, ; # or use PRANG::Coerce; PRANG::Coerce::coerce_arrayref_of('Type'); has_element 'an_array_of_types' => is => 'rw', isa => 'PRANG::Coerce::ArrayRefOfTypes', coerce => 1, ;
When defining a type which is an ArrayRef[Type], sometimes it's nice to be able to just pass in a Type. By using this module, that Type can be coerced into the 'ArrayRef[Type]' by using ArrayRefOfTypes.
ArrayRef[Type]
Type
ArrayRefOfTypes
PRANG::Coerce already defines two array types. These are for Str and Int and are defined as ArrayOfStrs and ArrayOfInts respectively.
Str
Int
ArrayOfStrs
ArrayOfInts
Development commissioned by NZ Registry Services, and carried out by Catalyst IT - http://www.catalyst.net.nz/
Copyright 2009, 2010, NZ Registry Services. This module is licensed under the Artistic License v2.0, which permits relicensing under other Free Software licenses.
To install PRANG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PRANG
CPAN shell
perl -MCPAN -e shell install PRANG
For more information on module installation, please visit the detailed CPAN module installation guide.