MooseX::Types::Stringlike - Moose type constraints for strings or string-like objects
version 0.001
package Foo; use Moose; use MooseX::Types::Stringlike qw/Stringlike Stringable/; has path => ( is => 'ro', isa => Stringlike, coerce => 1 ); has stringable_object => ( is => 'ro', isa => Stringable, );
This module provides a more general version of the Str type. If coercions are enabled, it will accepts objects that overload stringification and coerces them into strings.
Str
This module uses MooseX::Types to define the following subtypes.
Stringlike is a subtype of Str. It can coerce Stringable objects into a string.
Stringlike
Stringable
Stringable is a subtype of Object where the object has overloaded stringification.
Object
Moose::Manual::Types
MooseX::Types
Thank you to Dagfinn Ilmari Mannsåker for the idea on IRC that led to this module.
Please report any bugs or feature requests through the issue tracker at http://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-Stringlike. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
https://github.com/dagolden/moosex-types-stringlike
git clone https://github.com/dagolden/moosex-types-stringlike.git
David Golden <dagolden@cpan.org>
This software is Copyright (c) 2012 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Mannsåker'. Assuming UTF-8
To install MooseX::Types::Stringlike, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Types::Stringlike
CPAN shell
perl -MCPAN -e shell install MooseX::Types::Stringlike
For more information on module installation, please visit the detailed CPAN module installation guide.