MooseX::Types::CanonOpenModeStr - Type for canonical open mode string |
MooseX::Types::CanonOpenModeStr - Type for canonical open mode string
package My::Class; use Moose; use MooseX::Types::CanonOpenModeStr; has file => ( isa => 'Str' ); has mode => ( isa => 'CanonOpenModeStr', coerce => 1 );
package main; # This will be coerced my $fin = My::Class->new( file => '/etc/passwd', mode => 'r' ); # This is native mode my $fout = My::Class->new( file => '/tmp/pwdnew', mode => '>' );
This module provides Moose type which represents Perl-style canonical open mode string (i.e. "+>").
the Moose::Util::TypeConstraints manpage, the IO::Moose manpage.
Piotr Roszatycki <dexter@cpan.org>
Copyright (C) 2007, 2008, 2009 by Piotr Roszatycki <dexter@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
MooseX::Types::CanonOpenModeStr - Type for canonical open mode string |