Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mouse::exporter(3pm) [debian man page]

Mouse::Exporter(3pm)					User Contributed Perl Documentation				      Mouse::Exporter(3pm)

NAME
Mouse::Exporter - make an import() and unimport() just like Mouse.pm VERSION
This document describes Mouse version 0.99 SYNOPSIS
package MyApp::Mouse; use Mouse (); use Mouse::Exporter; Mouse::Exporter->setup_import_methods( as_is => [ 'has_rw', 'other_sugar', &Some::Random::thing ], also => 'Mouse', ); sub has_rw { my $meta = caller->meta; my ( $name, %options ) = @_; $meta->add_attribute( $name, is => 'rw', %options, ); } # then later ... package MyApp::User; use MyApp::Mouse; has 'name'; has_rw 'size'; thing; no MyApp::Mouse; DESCRIPTION
This module encapsulates the exporting of sugar functions in a "Mouse.pm"-like manner. It does this by building custom "import", "unimport" methods for your module, based on a spec you provide. Note that "Mouse::Exporter" does not provide the "with_meta" option, but you can easily get the metaclass by "caller->meta" as "SYNOPSIS" shows. METHODS
"setup_import_methods( ARGS )" "build_import_methods( ARGS ) -> (&import, &unimport)" SEE ALSO
Moose::Exporter perl v5.14.2 2012-06-30 Mouse::Exporter(3pm)

Check Out this Related Man Page

Mouse::Util(3pm)					User Contributed Perl Documentation					  Mouse::Util(3pm)

NAME
Mouse::Util - Utilities for working with Mouse classes VERSION
This document describes Mouse version 0.99 SYNOPSIS
use Mouse::Util; # turns on strict and warnings DESCRIPTION
This module provides a set of utility functions. Many of these functions are intended for use in Mouse itself or MouseX modules, but some of them may be useful for use in your own code. IMPLEMENTATIONS FOR
Moose::Util functions The following functions are exportable. "find_meta($class_or_obj)" The same as "Mouse::Util::class_of()". "does_role($class_or_obj, $role_or_obj)" "resolve_metaclass_alias($category, $name, %options)" "apply_all_roles($applicant, @roles)" "english_listi(@items)" Class::MOP functions The following functions are not exportable. "Mouse::Util::is_class_loaded($classname) -> Bool" Returns whether $classname is actually loaded or not. It uses a heuristic which involves checking for the existence of $VERSION, @ISA, and any locally-defined method. "Mouse::Util::load_class($classname) -> ClassName" This will load a given $classname (or die if it is not loadable). This function can be used in place of tricks like "eval "use $module ()"" or using "require". "Mouse::Util::class_of($classname_or_object) -> MetaClass" "Mouse::Util::get_metaclass_by_name($classname) -> MetaClass" "Mouse::Util::get_all_metaclass_instances() -> (MetaClasses)" "Mouse::Util::get_all_metaclass_names() -> (ClassNames)" mro (or MRO::Compat) "get_linear_isa" Sub::Identify "get_code_info" Mouse specific utilities "not_supported" "get_code_package" "get_code_ref" SEE ALSO
Moose::Util Class::MOP Sub::Identify mro MRO::Compat perl v5.14.2 2012-06-30 Mouse::Util(3pm)
Man Page