
MooseX::Types::Moose::Overload - Deal with overload, in the overloaded sense ;)

This module subclasses MooseX::Types::Moose with an ability to transparently handle overloaded objects.
All you have to do is use it,
and then add coerce => 1 to the attributes you wish to enable it on.
It will then stringify all objects that support the stringifiy method.
This works in the style of overload,
forcing Moose to just do you want.
Something that stringifies to a string should simply work when the attribute isa Str,
rightâ½ Good,
thought so.
This modifies the base types in a slightly ugly way and has little to nothing to do with MooseX types. I reserve the right to remove it from cpan, or change its namespace until it is removed from DEV status; because the base types are global, this attaches to all modules that use the base types.
This only attaches a coercion to subtypes of "Value", and it only coerces from "Objects", and only executes on Objects that stringify overload.

use MooseX::Types::Moose::Overload;
## Now takes a URI object, or HTTP::Element, and of course a plain string.
has 'uri' => ( isa => 'Str', is => 'rw', coerce => 1 );

These aren't set in stone:

Evan Carroll, <me at evancarroll.com>

Please report any bugs or feature requests to bug-moosex-types-overload at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Types-Moose-Overload. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

You can find documentation for this module with the perldoc command.
perldoc MooseX::Types::Overload
You can also look for information at:
http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Types-Overload

Copyright 2008 Evan Carroll, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.