MooseX::GlobRef::Role::Object man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

MooseX::GlobRef::Role:UsereContributed Perl DoMooseX::GlobRef::Role::Object(3)

NAME
       MooseX::GlobRef::Role::Object - An object role for MooseX::GlobRef

SYNOPSIS
	 Moose::Util::MetaRole::apply_base_class_roles(
	     for_class => $caller,
	     roles => [ 'MooseX::GlobRef::Role::Object' ],
	 );

	 package My::IO::File;

	 use Moose;

	 extends 'Moose::Object', 'IO::File';
	 with 'MooseX::GlobRef::Role::Object';

	 has 'file' => ( is => 'ro', isa => 'Str', required => 1 );
	 has 'mode' => ( is => 'ro', isa => 'Str', default => 'r' );

	 sub BUILD {
	     my ($fh) = @_;
	     $fh->open( $fh->file, $fh->mode );
	 };

	 sub slurp {
	   my ($fh) = @_;
	   local $/ = undef;
	   return $fh->getline;
	 };

	 my $io = My::IO::File->new( file => '/etc/passwd' );
	 print "::::::::::::::\n";
	 print $io->file, "\n";
	 print "::::::::::::::\n";
	 print $io->slurp;

DESCRIPTION
       This is a role for Moose::Object which is applied by MooseX::GlobRef.
       It allows to store Moose object in glob reference of file handle.

       The MooseX::GlobRef package should be used instead for Moose classes
       but the "MooseX::GlobRef::Role::Object" can be helpful if you want to
       extend non-Moose classes like IO::File or File::Temp.

METHODS
       <<around>> dump( maxdepth : Int = 1 ) : Array|Str
	   Dumps the object itself and also a hash slot of glob reference of
	   this object.	 It returns an array or string depended on context.

	   See Moose::Object.

SEE ALSO
       MooseX::GlobRef, Moose::Object, Moose::Role.

AUTHOR
       Piotr Roszatycki <dexter@cpan.org>

LICENSE
       Copyright (c) 2007, 2008, 2009, 2010 Piotr Roszatycki
       <dexter@cpan.org>.

       This is free software; you can redistribute it and/or modify it under
       the same terms as perl itself.

       See <http://dev.perl.org/licenses/artistic.html>

perl v5.14.1			  2011-07-20  MooseX::GlobRef::Role::Object(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net