GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MOOSE::AUTOBOX (3)

.ds Aq ’

NAME

Moose::Autobox - Autoboxed wrappers for Native Perl datatypes

CONTENTS

SYNOPOSIS



  use Moose::Autobox;
 
  print Print squares from 1 to 10 : ;
  print [ 1 .. 10 ]->map(sub { $_ * $_ })->join(, );



DESCRIPTION

Moose::Autobox provides an implementation of SCALAR, ARRAY, HASH & CODE for use with autobox. It does this using a hierarchy of roles in a manner similar to what Perl 6 might do. This module, like Class::MOP and Moose, was inspired by my work on the Perl 6 Object Space, and the ’core types’ implemented there.

    A quick word about autobox

The autobox module provides the ability for calling ’methods’ on normal Perl values like Scalars, Arrays, Hashes and Code references. This gives the illusion that Perl’s types are first-class objects. However, this is only an illusion, albeit a very nice one. I created this module because autobox itself does not actually provide an implementation for the Perl types but instead only provides the ’hooks’ for others to add implementation too.

    Is this for real? or just play?

Several people are using this module in serious applications and it seems to be quite stable. The underlying technologies of autobox and Moose::Role are also considered stable. There is some performance hit, but as I am fond of saying, nothing in life is free. Note that this hit only applies to the use of methods on native Perl values, not the mere act of loading this module in your namespace.

If you have any questions regarding this module, either email me, or stop by #moose on irc.perl.org and ask around.

    Adding additional methods

<B>Moose::AutoboxB> asks autobox to use the <B>Moose::Autobox::*B> namespace prefix so as to avoid stepping on the toes of other autobox modules. This means that if you want to add methods to a particular perl type (i.e. - monkeypatch), then you must do this:



  sub Moose::Autobox::SCALAR::bar { 42 }



instead of this:



  sub SCALAR::bar { 42 }



as you would with vanilla autobox.

METHODS

<B>mixin_additional_role ($type, B>$role<B>)B> This will mixin an additional $role into a certain $type. The types can be SCALAR, ARRAY, HASH or CODE.

This can be used to add additional methods to the types, see the examples/units/ directory for some examples.

TODO

More docs
More tests

BUGS

All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.

AUTHOR

Stevan Little <stevan@iinteractive.com>

<B>with contributions from:B>

Anders (Debolaz) Nor Berle

Matt (mst) Trout

renormalist

COPYRIGHT AND LICENSE

Copyright 2006-2008 by Infinity Interactive, Inc.

<http://www.iinteractive.com>

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

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOOSE::AUTOBOX (3) 2013-10-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.