2 package Moose::Meta::Role;
8 use Scalar::Util 'blessed';
10 use Sub::Name 'subname';
12 our $VERSION = '0.76';
13 $VERSION = eval $VERSION;
14 our $AUTHORITY = 'cpan:STEVAN';
16 use Moose::Meta::Class;
17 use Moose::Meta::Role::Method;
18 use Moose::Meta::Role::Method::Required;
20 use base 'Class::MOP::Module';
22 ## ------------------------------------------------------------------
24 ## I normally don't do this, but I am doing
25 ## a whole bunch of meta-programmin in this
26 ## module, so it just makes sense. For a clearer
27 ## picture of what is going on in the next
28 ## several lines of code, look at the really
29 ## big comment at the end of this file (right
32 ## ------------------------------------------------------------------
34 my $META = __PACKAGE__->meta;
36 ## ------------------------------------------------------------------
40 # since roles are lazy, we hold all the attributes
41 # of the individual role in 'statis' until which
42 # time when it is applied to a class. This means
43 # keeping a lot of things in hash maps, so we are
44 # using a little of that meta-programmin' magic
45 # here an saving lots of extra typin. And since
46 # many of these attributes above require similar
47 # functionality to support them, so we again use
48 # the wonders of meta-programmin' to deliver a
49 # very compact solution to this normally verbose
55 name => 'excluded_roles_map',
56 attr_reader => 'get_excluded_roles_map' ,
58 add => 'add_excluded_roles',
59 get_list => 'get_excluded_roles_list',
60 existence => 'excludes_role',
64 name => 'required_methods',
65 attr_reader => 'get_required_methods_map',
67 add => 'add_required_methods',
68 remove => 'remove_required_methods',
69 get_list => 'get_required_method_list',
70 existence => 'requires_method',
74 name => 'attribute_map',
75 attr_reader => 'get_attribute_map',
77 get => 'get_attribute',
78 get_list => 'get_attribute_list',
79 existence => 'has_attribute',
80 remove => 'remove_attribute',
85 my $attr_reader = $action->{attr_reader};
86 my $methods = $action->{methods};
88 # create the attribute
89 $META->add_attribute($action->{name} => (
90 reader => $attr_reader,
94 # create some helper methods
95 $META->add_method($methods->{add} => sub {
96 my ($self, @values) = @_;
97 $self->$attr_reader->{$_} = undef foreach @values;
98 }) if exists $methods->{add};
100 $META->add_method($methods->{get_list} => sub {
102 keys %{$self->$attr_reader};
103 }) if exists $methods->{get_list};
105 $META->add_method($methods->{get} => sub {
106 my ($self, $name) = @_;
107 $self->$attr_reader->{$name}
108 }) if exists $methods->{get};
110 $META->add_method($methods->{existence} => sub {
111 my ($self, $name) = @_;
112 exists $self->$attr_reader->{$name} ? 1 : 0;
113 }) if exists $methods->{existence};
115 $META->add_method($methods->{remove} => sub {
116 my ($self, @values) = @_;
117 delete $self->$attr_reader->{$_} foreach @values;
118 }) if exists $methods->{remove};
121 $META->add_attribute(
123 reader => 'method_metaclass',
124 default => 'Moose::Meta::Role::Method',
127 ## some things don't always fit, so they go here ...
132 unless ( defined $name && $name ) {
134 Moose->throw_error("You must provide a name for the attribute");
137 if (scalar @_ == 1 && ref($_[0]) eq 'HASH') {
143 $self->get_attribute_map->{$name} = $attr_desc;
146 ## ------------------------------------------------------------------
150 # the before/around/after method modifiers are
151 # stored by name, but there can be many methods
152 # then associated with that name. So again we have
153 # lots of similar functionality, so we can do some
154 # meta-programmin' and save some time.
157 foreach my $modifier_type (qw[ before around after ]) {
159 my $attr_reader = "get_${modifier_type}_method_modifiers_map";
161 # create the attribute ...
162 $META->add_attribute("${modifier_type}_method_modifiers" => (
163 reader => $attr_reader,
164 default => sub { {} }
167 # and some helper methods ...
168 $META->add_method("get_${modifier_type}_method_modifiers" => sub {
169 my ($self, $method_name) = @_;
170 #return () unless exists $self->$attr_reader->{$method_name};
171 @{$self->$attr_reader->{$method_name}};
174 $META->add_method("has_${modifier_type}_method_modifiers" => sub {
175 my ($self, $method_name) = @_;
177 # for now we assume that if it exists,..
178 # it has at least one modifier in it
179 (exists $self->$attr_reader->{$method_name}) ? 1 : 0;
182 $META->add_method("add_${modifier_type}_method_modifier" => sub {
183 my ($self, $method_name, $method) = @_;
185 $self->$attr_reader->{$method_name} = []
186 unless exists $self->$attr_reader->{$method_name};
188 my $modifiers = $self->$attr_reader->{$method_name};
191 # check to see that we aren't adding the
192 # same code twice. We err in favor of the
193 # first on here, this may not be as expected
194 foreach my $modifier (@{$modifiers}) {
195 return if $modifier == $method;
198 push @{$modifiers} => $method;
203 ## ------------------------------------------------------------------
204 ## override method mofidiers
206 $META->add_attribute('override_method_modifiers' => (
207 reader => 'get_override_method_modifiers_map',
208 default => sub { {} }
212 # these are a little different because there
213 # can only be one per name, whereas the other
214 # method modifiers can have multiples.
217 sub add_override_method_modifier {
218 my ($self, $method_name, $method) = @_;
219 (!$self->has_method($method_name))
220 || Moose->throw_error("Cannot add an override of method '$method_name' " .
221 "because there is a local version of '$method_name'");
222 $self->get_override_method_modifiers_map->{$method_name} = $method;
225 sub has_override_method_modifier {
226 my ($self, $method_name) = @_;
228 # for now we assume that if it exists,..
229 # it has at least one modifier in it
230 (exists $self->get_override_method_modifiers_map->{$method_name}) ? 1 : 0;
233 sub get_override_method_modifier {
234 my ($self, $method_name) = @_;
235 $self->get_override_method_modifiers_map->{$method_name};
238 ## general list accessor ...
240 sub get_method_modifier_list {
241 my ($self, $modifier_type) = @_;
242 my $accessor = "get_${modifier_type}_method_modifiers_map";
243 keys %{$self->$accessor};
246 sub reset_package_cache_flag { (shift)->{'_package_cache_flag'} = undef }
247 sub update_package_cache_flag {
249 $self->{'_package_cache_flag'} = Class::MOP::check_package_cache_flag($self->name);
254 ## ------------------------------------------------------------------
257 $META->add_attribute('roles' => (
258 reader => 'get_roles',
259 default => sub { [] }
263 my ($self, $role) = @_;
264 (blessed($role) && $role->isa('Moose::Meta::Role'))
265 || Moose->throw_error("Roles must be instances of Moose::Meta::Role");
266 push @{$self->get_roles} => $role;
267 $self->reset_package_cache_flag;
270 sub calculate_all_roles {
276 $_->calculate_all_roles
277 } @{ $self->get_roles });
281 my ($self, $role_name) = @_;
283 || Moose->throw_error("You must supply a role name to look for");
284 # if we are it,.. then return true
285 return 1 if $role_name eq $self->name;
286 # otherwise.. check our children
287 foreach my $role (@{$self->get_roles}) {
288 return 1 if $role->does_role($role_name);
293 ## ------------------------------------------------------------------
299 my $current = Class::MOP::check_package_cache_flag($self->name);
301 if (defined $self->{'_package_cache_flag'} && $self->{'_package_cache_flag'} == $current) {
302 return $self->{'methods'} ||= {};
305 $self->{_package_cache_flag} = $current;
307 my $map = $self->{'methods'} ||= {};
309 my $role_name = $self->name;
310 my $method_metaclass = $self->method_metaclass;
312 my $all_code = $self->get_all_package_symbols('CODE');
314 foreach my $symbol (keys %{ $all_code }) {
315 my $code = $all_code->{$symbol};
317 next if exists $map->{$symbol} &&
318 defined $map->{$symbol} &&
319 $map->{$symbol}->body == $code;
321 my ($pkg, $name) = Class::MOP::get_code_info($code);
322 my $meta = Class::MOP::class_of($pkg);
324 if ($meta && $meta->isa('Moose::Meta::Role')) {
325 my $role = $meta->name;
326 next unless $self->does_role($role);
330 # in 5.10 constant.pm the constants show up
331 # as being in the right package, but in pre-5.10
332 # they show up as constant::__ANON__ so we
333 # make an exception here to be sure that things
334 # work as expected in both.
336 unless ($pkg eq 'constant' && $name eq '__ANON__') {
337 next if ($pkg || '') ne $role_name ||
338 (($name || '') ne '__ANON__' && ($pkg || '') ne $role_name);
342 $map->{$symbol} = $method_metaclass->wrap(
344 package_name => $role_name,
353 my ($self, $name) = @_;
354 $self->get_method_map->{$name};
358 my ($self, $name) = @_;
359 exists $self->get_method_map->{$name} ? 1 : 0
362 # FIXME this is copy-pasted from Class::MOP::Class
363 # refactor to inherit from some common base
364 sub wrap_method_body {
365 my ( $self, %args ) = @_;
367 ('CODE' eq ref $args{body})
368 || Moose->throw_error("Your code block must be a CODE reference");
370 $self->method_metaclass->wrap(
371 package_name => $self->name,
377 my ($self, $method_name, $method) = @_;
378 (defined $method_name && $method_name)
379 || Moose->throw_error("You must define a method name");
382 if (blessed($method)) {
383 $body = $method->body;
384 if ($method->package_name ne $self->name) {
385 $method = $method->clone(
386 package_name => $self->name,
388 ) if $method->can('clone');
393 $method = $self->wrap_method_body( body => $body, name => $method_name );
396 $method->attach_to_class($self);
398 $self->get_method_map->{$method_name} = $method;
400 my $full_method_name = ($self->name . '::' . $method_name);
401 $self->add_package_symbol(
402 { sigil => '&', type => 'CODE', name => $method_name },
403 subname($full_method_name => $body)
406 $self->update_package_cache_flag; # still valid, since we just added the method to the map, and if it was invalid before that then get_method_map updated it
409 sub find_method_by_name { (shift)->get_method(@_) }
411 sub get_method_list {
413 grep { !/^meta$/ } keys %{$self->get_method_map};
417 Carp::cluck("The alias_method method is deprecated. Use add_method instead.\n");
421 $self->add_method(@_);
424 ## ------------------------------------------------------------------
426 ## ------------------------------------------------------------------
429 my ($self, $other, @args) = @_;
432 || Moose->throw_error("You must pass in an blessed instance");
434 if ($other->isa('Moose::Meta::Role')) {
435 require Moose::Meta::Role::Application::ToRole;
436 return Moose::Meta::Role::Application::ToRole->new(@args)->apply($self, $other);
438 elsif ($other->isa('Moose::Meta::Class')) {
439 require Moose::Meta::Role::Application::ToClass;
440 return Moose::Meta::Role::Application::ToClass->new(@args)->apply($self, $other);
443 require Moose::Meta::Role::Application::ToInstance;
444 return Moose::Meta::Role::Application::ToInstance->new(@args)->apply($self, $other);
449 my ($class, @role_specs) = @_;
451 require Moose::Meta::Role::Application::RoleSummation;
452 require Moose::Meta::Role::Composite;
454 my (@roles, %role_params);
455 while (@role_specs) {
456 my ($role, $params) = @{ splice @role_specs, 0, 1 };
457 push @roles => Class::MOP::class_of($role);
458 next unless defined $params;
459 $role_params{$role} = $params;
462 my $c = Moose::Meta::Role::Composite->new(roles => \@roles);
463 Moose::Meta::Role::Application::RoleSummation->new(
464 role_params => \%role_params
471 my ( $role, $package_name, %options ) = @_;
473 $options{package} = $package_name;
475 (ref $options{attributes} eq 'HASH')
476 || confess "You must pass a HASH ref of attributes"
477 if exists $options{attributes};
479 (ref $options{methods} eq 'HASH')
480 || confess "You must pass a HASH ref of methods"
481 if exists $options{methods};
483 my (%initialize_options) = %options;
484 delete @initialize_options{qw(
492 my $meta = $role->initialize( $package_name => %initialize_options );
494 $meta->_instantiate_module( $options{version}, $options{authority} );
497 $meta->add_method('meta' => sub {
498 $role->initialize(ref($_[0]) || $_[0]);
501 if (exists $options{attributes}) {
502 foreach my $attribute_name (keys %{$options{attributes}}) {
503 my $attr = $options{attributes}->{$attribute_name};
504 $meta->add_attribute($attribute_name => $attr);
508 if (exists $options{methods}) {
509 foreach my $method_name (keys %{$options{methods}}) {
510 $meta->add_method($method_name, $options{methods}->{$method_name});
514 Class::MOP::weaken_metaclass($meta->name)
515 if $meta->is_anon_role;
520 # anonymous roles. most of it is copied straight out of Class::MOP::Class.
521 # an intrepid hacker might find great riches if he unifies this code with that
522 # code in Class::MOP::Module or Class::MOP::Package
525 # this should be sufficient, if you have a
526 # use case where it is not, write a test and
528 my $ANON_ROLE_SERIAL = 0;
531 # we need a sufficiently annoying prefix
532 # this should suffice for now, this is
533 # used in a couple of places below, so
534 # need to put it up here for now.
535 my $ANON_ROLE_PREFIX = 'Moose::Meta::Role::__ANON__::SERIAL::';
539 no warnings 'uninitialized';
540 $self->name =~ /^$ANON_ROLE_PREFIX/;
543 sub create_anon_role {
544 my ($role, %options) = @_;
545 my $package_name = $ANON_ROLE_PREFIX . ++$ANON_ROLE_SERIAL;
546 return $role->create($package_name, %options);
550 # this will only get called for
551 # anon-roles, all other calls
552 # are assumed to occur during
553 # global destruction and so don't
554 # really need to be handled explicitly
558 return if Class::MOP::in_global_destruction(); # it'll happen soon anyway and this just makes things more complicated
560 no warnings 'uninitialized';
561 return unless $self->name =~ /^$ANON_ROLE_PREFIX/;
563 # XXX: is this necessary for us? I don't understand what it's doing
566 # Moose does a weird thing where it replaces the metaclass for
567 # class when fixing metaclass incompatibility. In that case,
568 # we don't want to clean out the namespace now. We can detect
569 # that because Moose will explicitly update the singleton
570 # cache in Class::MOP.
571 #my $current_meta = Class::MOP::get_metaclass_by_name($self->name);
572 #return if $current_meta ne $self;
574 my ($serial_id) = ($self->name =~ /^$ANON_ROLE_PREFIX(\d+)/);
576 foreach my $key (keys %{$ANON_ROLE_PREFIX . $serial_id}) {
577 delete ${$ANON_ROLE_PREFIX . $serial_id}{$key};
579 delete ${'main::' . $ANON_ROLE_PREFIX}{$serial_id . '::'};
583 #####################################################################
585 ## This is Moose::Meta::Role as defined by Moose (plus the use of
586 ## MooseX::AttributeHelpers module). It is here as a reference to
587 ## make it easier to see what is happening above with all the meta
589 #####################################################################
592 # metaclass => 'Collection::Array',
593 # reader => 'get_roles',
594 # isa => 'ArrayRef[Moose::Meta::Roles]',
595 # default => sub { [] },
597 # 'push' => 'add_role',
601 # has 'excluded_roles_map' => (
602 # metaclass => 'Collection::Hash',
603 # reader => 'get_excluded_roles_map',
604 # isa => 'HashRef[Str]',
606 # # Not exactly set, cause it sets multiple
607 # 'set' => 'add_excluded_roles',
608 # 'keys' => 'get_excluded_roles_list',
609 # 'exists' => 'excludes_role',
613 # has 'attribute_map' => (
614 # metaclass => 'Collection::Hash',
615 # reader => 'get_attribute_map',
616 # isa => 'HashRef[Str]',
618 # # 'set' => 'add_attribute' # has some special crap in it
619 # 'get' => 'get_attribute',
620 # 'keys' => 'get_attribute_list',
621 # 'exists' => 'has_attribute',
622 # # Not exactly delete, cause it sets multiple
623 # 'delete' => 'remove_attribute',
627 # has 'required_methods' => (
628 # metaclass => 'Collection::Hash',
629 # reader => 'get_required_methods_map',
630 # isa => 'HashRef[Str]',
632 # # not exactly set, or delete since it works for multiple
633 # 'set' => 'add_required_methods',
634 # 'delete' => 'remove_required_methods',
635 # 'keys' => 'get_required_method_list',
636 # 'exists' => 'requires_method',
640 # # the before, around and after modifiers are
641 # # HASH keyed by method-name, with ARRAY of
642 # # CODE refs to apply in that order
644 # has 'before_method_modifiers' => (
645 # metaclass => 'Collection::Hash',
646 # reader => 'get_before_method_modifiers_map',
647 # isa => 'HashRef[ArrayRef[CodeRef]]',
649 # 'keys' => 'get_before_method_modifiers',
650 # 'exists' => 'has_before_method_modifiers',
651 # # This actually makes sure there is an
652 # # ARRAY at the given key, and pushed onto
653 # # it. It also checks for duplicates as well
654 # # 'add' => 'add_before_method_modifier'
658 # has 'after_method_modifiers' => (
659 # metaclass => 'Collection::Hash',
660 # reader =>'get_after_method_modifiers_map',
661 # isa => 'HashRef[ArrayRef[CodeRef]]',
663 # 'keys' => 'get_after_method_modifiers',
664 # 'exists' => 'has_after_method_modifiers',
665 # # This actually makes sure there is an
666 # # ARRAY at the given key, and pushed onto
667 # # it. It also checks for duplicates as well
668 # # 'add' => 'add_after_method_modifier'
672 # has 'around_method_modifiers' => (
673 # metaclass => 'Collection::Hash',
674 # reader =>'get_around_method_modifiers_map',
675 # isa => 'HashRef[ArrayRef[CodeRef]]',
677 # 'keys' => 'get_around_method_modifiers',
678 # 'exists' => 'has_around_method_modifiers',
679 # # This actually makes sure there is an
680 # # ARRAY at the given key, and pushed onto
681 # # it. It also checks for duplicates as well
682 # # 'add' => 'add_around_method_modifier'
686 # # override is similar to the other modifiers
687 # # except that it is not an ARRAY of code refs
688 # # but instead just a single name->code mapping
690 # has 'override_method_modifiers' => (
691 # metaclass => 'Collection::Hash',
692 # reader =>'get_override_method_modifiers_map',
693 # isa => 'HashRef[CodeRef]',
695 # 'keys' => 'get_override_method_modifier',
696 # 'exists' => 'has_override_method_modifier',
697 # 'add' => 'add_override_method_modifier', # checks for local method ..
701 #####################################################################
712 Moose::Meta::Role - The Moose Role metaclass
716 This class is a subclass of L<Class::MOP::Module> that provides
717 additional Moose-specific functionality.
719 It's API looks a lot like L<Moose::Meta::Class>, but internally it
720 implements many things differently. This may change in the future.
724 C<Moose::Meta::Role> is a subclass of L<Class::MOP::Module>.
732 =item B<< Moose::Meta::Role->initialize($role_name) >>
734 This method creates a new role object with the provided name.
736 =item B<< Moose::Meta::Role->combine( [ $role => { ... } ], [ $role ], ... ) >>
738 This method accepts a list of array references. Each array reference
739 should contain a role name as its first element. The second element is
740 an optional hash reference. The hash reference can contain C<exclude>
741 and C<alias> keys to control how methods are composed from the role.
743 The return value is a new L<Moose::Meta::Role::Composite> that
744 represents the combined roles.
746 =item B<< Moose::Meta::Role->create($name, %options) >>
748 This method is identical to the L<Moose::Meta::Class> C<create>
751 =item B<< Moose::Meta::Role->create_anon_role >>
753 This method is identical to the L<Moose::Meta::Class>
754 C<create_anon_class> method.
756 =item B<< $metarole->is_anon_role >>
758 Returns true if the role is an anonymous role.
762 =head2 Role application
766 =item B<< $metarole->apply( $thing, @options ) >>
768 This method applies a role to the given C<$thing>. That can be another
769 L<Moose::Meta::Role>, object, a L<Moose::Meta::Class> object, or a
770 (non-meta) object instance.
772 The options are passed directly to the constructor for the appropriate
773 L<Moose::Meta::Role::Application> subclass.
775 Note that this will apply the role even if the C<$thing> in question already
776 C<does> this role. L<Moose::Util/does_role> is a convenient wrapper for
777 finding out if role application is necessary.
781 =head2 Roles and other roles
785 =item B<< $metarole->get_roles >>
787 This returns an array reference of roles which this role does. This
788 list may include duplicates.
790 =item B<< $metarole->calculate_all_roles >>
792 This returns a I<unique> list of all roles that this role does, and
793 all the roles that its roles do.
795 =item B<< $metarole->does_role($role_name) >>
797 Given a role I<name>, returns true if this role does the given
800 =item B<< $metarole->add_role($role) >>
802 Given a L<Moose::Meta::Role> object, this adds the role to the list of
803 roles that the role does.
805 =item B<< $metarole->get_excluded_roles_list >>
807 Returns a list of role names which this role excludes.
809 =item B<< $metarole->excludes_role($role_name) >>
811 Given a role I<name>, returns true if this role excludes the named
814 =item B<< $metarole->add_excluded_roles(@role_names) >>
816 Given one or more role names, adds those roles to the list of excluded
823 The methods for dealing with a role's methods are all identical in API
824 and behavior to the same methods in L<Class::MOP::Class>.
828 =item B<< $metarole->method_metaclass >>
830 Returns the method metaclass name for the role. This defaults to
831 L<Moose::Meta::Role::Method>.
833 =item B<< $metarole->get_method($name) >>
835 =item B<< $metarole->has_method($name) >>
837 =item B<< $metarole->add_method( $name, $body ) >>
839 =item B<< $metarole->get_method_list >>
841 =item B<< $metarole->get_method_map >>
843 =item B<< $metarole->find_method_by_name($name) >>
845 These methods are all identical to the methods of the same name in
852 As with methods, the methods for dealing with a role's attribute are
853 all identical in API and behavior to the same methods in
854 L<Class::MOP::Class>.
856 However, attributes stored in this class are I<not> stored as
857 objects. Rather, the attribute definition is stored as a hash
858 reference. When a role is composed into a class, this hash reference
859 is passed directly to the metaclass's C<add_attribute> method.
861 This is quite likely to change in the future.
865 =item B<< $metarole->get_attribute($attribute_name) >>
867 =item B<< $metarole->has_attribute($attribute_name) >>
869 =item B<< $metarole->get_attribute_map >>
871 =item B<< $metarole->get_attribute_list >>
873 =item B<< $metarole->add_attribute($name, %options) >>
875 =item B<< $metarole->remove_attribute($attribute_name) >>
879 =head2 Required methods
883 =item B<< $metarole->get_required_method_list >>
885 Returns the list of methods required by the role.
887 =item B<< $metarole->requires_method($name) >>
889 Returns true if the role requires the named method.
891 =item B<< $metarole->add_required_methods(@names >>
893 Adds the named methods to the roles list of required methods.
895 =item B<< $metarole->remove_required_methods(@names) >>
897 Removes the named methods to the roles list of required methods.
901 =head2 Method modifiers
903 These methods act like their counterparts in L<Class::Mop::Class> and
904 L<Moose::Meta::Class>.
906 However, method modifiers are simply stored internally, and are not
907 applied until the role itself is applied to a class.
911 =item B<< $metarole->add_after_method_modifier($method_name, $method) >>
913 =item B<< $metarole->add_around_method_modifier($method_name, $method) >>
915 =item B<< $metarole->add_before_method_modifier($method_name, $method) >>
917 =item B<< $metarole->add_override_method_modifier($method_name, $method) >>
919 These methods all add an appropriate modifier to the internal list of
922 =item B<< $metarole->has_after_method_modifiers >>
924 =item B<< $metarole->has_around_method_modifiers >>
926 =item B<< $metarole->has_before_method_modifiers >>
928 =item B<< $metarole->has_override_method_modifier >>
930 Return true if the role has any modifiers of the given type.
932 =item B<< $metarole->get_after_method_modifiers($method_name) >>
934 =item B<< $metarole->get_around_method_modifiers($method_name) >>
936 =item B<< $metarole->get_before_method_modifiers($method_name) >>
938 Given a method name, returns a list of the appropriate modifiers for
941 =item B<< $metarole->get_override_method_modifier($method_name) >>
943 Given a method name, returns the override method modifier for that
944 method, if it has one.
952 =item B<< Moose::Meta::Role->meta >>
954 This will return a L<Class::MOP::Class> instance for this class.
960 All complex software has bugs lurking in it, and this module is no
961 exception. If you find a bug please either email me, or add the bug
966 Stevan Little E<lt>stevan@iinteractive.comE<gt>
968 =head1 COPYRIGHT AND LICENSE
970 Copyright 2006-2009 by Infinity Interactive, Inc.
972 L<http://www.iinteractive.com>
974 This library is free software; you can redistribute it and/or modify
975 it under the same terms as Perl itself.