IO::Moose - Reimplementation of IO::* with improvements
use IO::Moose 'Handle', 'File'; # loads IO::Moose::* modules $passwd = IO::Moose::File->new( file => '/etc/passwd' )->slurp;
IO::Moose provides a simple mechanism to load several modules in one go.
IO::Moose
IO::Moose::* classes provide an interface mostly compatible with IO. The differences:
IO::Moose::*
It is based on Moose object framework.
It uses Exception::Base for signaling errors. Most of methods are throwing exception on failure.
The modifiers like input_record_separator are supported on per file handler basis.
input_record_separator
It also implements additional methods like say, slurp.
say
slurp
Loads a modules from IO::Moose::* hierarchy. I.e. Handle parameter loads IO::Moose::Handle module.
Handle
IO::Moose::Handle
use IO::Moose 'Handle', 'File'; # loads IO::Moose::Handle and ::File.
If modules list is empty, it loads following modules at default:
IO::Moose::File
IO, Moose.
The API is not stable yet and can be changed in future.
Piotr Roszatycki <dexter@cpan.org>
Copyright 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
To install IO::Moose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Moose
CPAN shell
perl -MCPAN -e shell install IO::Moose
For more information on module installation, please visit the detailed CPAN module installation guide.