MouseX::AttributeHelpers::String
package MyHomePage; use Mouse; use MouseX::AttributeHelpers; has 'text' => ( metaclass => 'String', is => 'rw', isa => 'Str', default => '', provides => { append => 'add_text', clear => 'clear_text', }, ); package main; my $page = MyHomePage->new; $page->add_text("foo"); # same as $page->text($page->text . "foo"); $page->clear_text; # same as $page->text('');
This module provides a simple string attribute, to which mutating string operations can be applied more easily.
NAKAGAWA Masaki <masaki@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
MouseX::AttributeHelpers, MouseX::AttributeHelpers::Base
To install MouseX::AttributeHelpers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MouseX::AttributeHelpers
CPAN shell
perl -MCPAN -e shell install MouseX::AttributeHelpers
For more information on module installation, please visit the detailed CPAN module installation guide.