-
-
02 Apr 2014 14:39:27 UTC
- Distribution: MooseX-Types-IO
- Module version: 0.04
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (1898 / 210 / 0)
- Kwalitee
Bus factor: 1- 88.89% Coverage
- License: perl_5
- Activity
24 month- Tools
- Download (4.92KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- unknown
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
MooseX::Types::IO::All - IO::All related constraints and coercions for Moose
SYNOPSIS
package Foo; use Moose; use MooseX::Types::IO::All 'IO_All'; has io => ( isa => IO_All, is => "rw", coerce => 1, ); # later my $str = "test for IO::String\n line 2"; my $foo = Foo->new( io => \$str ); my $io = $foo->io; # IO::All::String # or my $filename = "file.txt"; my $foo = Foo->new( io => $filename ); my $io = $foo->io; # IO::All
DESCRIPTION
This module packages one Moose::Util::TypeConstraints with coercions, designed to work with the IO::All suite of objects.
CONSTRAINTS
- Str
-
io $_;
IO::All object.
- ScalarRef
-
my $s = io('$'); $s->print($$_);
IO::All::String object. so generally u need
${ $s->string_ref } # the content
instead of ->all or ->slurp
SEE ALSO
Moose, MooseX::Types, MooseX::Types::IO, IO::All
AUTHOR
Fayland Lam,
<fayland at gmail.com>
ACKNOWLEDGEMENTS
The Moose Team
COPYRIGHT & LICENSE
Copyright 2008 Fayland Lam, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install MooseX::Types::IO, copy and paste the appropriate command in to your terminal.
cpanm MooseX::Types::IO
perl -MCPAN -e shell install MooseX::Types::IO
For more information on module installation, please visit the detailed CPAN module installation guide.