NAME

MooseX::Traits::SetScalarByRef - Wrap a ScalarRef attribute's accessors to re-use a reference

SYNOPSIS

use MooseX::Traits::SetScalarByRef;
blah blah blah

DESCRIPTION

This module wraps a ScalarRef attribute's accessors to ensure that when the setter is called with a new ScalarRef (or something that can be coerced into a ScalarRef), rather that the usual set action happening, you copy the string stored in the new scalar into the old scalar.

EXPORT

None by default.

SEE ALSO

Mention other useful documentation such as the documentation of related modules or operating system documentation (such as man pages in UNIX), or any relevant external documentation such as RFCs or standards.

If you have a mailing list set up for your module, mention it here.

If you have a web site set up for your module, mention it here.

AUTHORS

A. U. Thor, <a.u.thor@a.galaxy.far.far.away>

CONTRIBUTORS

Many thanks to tobyink. He basicaklly wrote all the code for this module and provided it on stackoverflow.com.

Thanks to rsrchboy and @ether for the valuable feedback in #moose on irc.perl.org.

Thanks to Matt S Trout for the motivation of creating this module: Sufficiently encapsulated ugly is indistinguable from beautiful.

COPYRIGHT AND LICENSE

Copyright (C) 2014 by Alex Becker

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16.3 or, at your option, any later version of Perl 5 you may have available.