2 package Class::MOP::Class;
8 use Scalar::Util 'blessed', 'reftype';
9 use Sub::Name 'subname';
10 use B 'svref_2object';
13 our $VERSION = '0.05';
17 sub meta { Class::MOP::Class->initialize(blessed($_[0]) || $_[0]) }
22 # Metaclasses are singletons, so we cache them here.
23 # there is no need to worry about destruction though
24 # because they should die only when the program dies.
25 # After all, do package definitions even get reaped?
30 my $package_name = shift;
31 (defined $package_name && $package_name && !blessed($package_name))
32 || confess "You must pass a package name and it cannot be blessed";
33 $class->construct_class_instance(':package' => $package_name, @_);
36 # NOTE: (meta-circularity)
37 # this is a special form of &construct_instance
38 # (see below), which is used to construct class
39 # meta-object instances for any Class::MOP::*
40 # class. All other classes will use the more
41 # normal &construct_instance.
42 sub construct_class_instance {
45 my $package_name = $options{':package'};
46 (defined $package_name && $package_name)
47 || confess "You must pass a package name";
48 return $METAS{$package_name} if exists $METAS{$package_name};
49 $class = blessed($class) || $class;
50 # now create the metaclass
52 if ($class =~ /^Class::MOP::/) {
54 '$:package' => $package_name,
56 '$:attribute_metaclass' => $options{':attribute_metaclass'} || 'Class::MOP::Attribute',
57 '$:method_metaclass' => $options{':method_metaclass'} || 'Class::MOP::Method',
62 # it is safe to use meta here because
63 # class will always be a subclass of
64 # Class::MOP::Class, which defines meta
65 $meta = bless $class->meta->construct_instance(%options) => $class
67 # and check the metaclass compatibility
68 $meta->check_metaclass_compatability();
69 $METAS{$package_name} = $meta;
72 sub check_metaclass_compatability {
75 # this is always okay ...
76 return if blessed($self) eq 'Class::MOP::Class';
78 my @class_list = $self->class_precedence_list;
79 shift @class_list; # shift off $self->name
81 foreach my $class_name (@class_list) {
82 my $meta = $METAS{$class_name};
83 ($self->isa(blessed($meta)))
84 || confess $self->name . "->meta => (" . (blessed($self)) . ")" .
85 " is not compatible with the " .
86 $class_name . "->meta => (" . (blessed($meta)) . ")";
92 my ($class, $package_name, $package_version, %options) = @_;
93 (defined $package_name && $package_name)
94 || confess "You must pass a package name";
95 my $code = "package $package_name;";
96 $code .= "\$$package_name\:\:VERSION = '$package_version';"
97 if defined $package_version;
99 confess "creation of $package_name failed : $@" if $@;
100 my $meta = $class->initialize($package_name);
102 $meta->add_method('meta' => sub {
103 Class::MOP::Class->initialize(blessed($_[0]) || $_[0]);
106 $meta->superclasses(@{$options{superclasses}})
107 if exists $options{superclasses};
109 # process attributes first, so that they can
110 # install accessors, but locally defined methods
111 # can then overwrite them. It is maybe a little odd, but
112 # I think this should be the order of things.
113 if (exists $options{attributes}) {
114 foreach my $attr (@{$options{attributes}}) {
115 $meta->add_attribute($attr);
118 if (exists $options{methods}) {
119 foreach my $method_name (keys %{$options{methods}}) {
120 $meta->add_method($method_name, $options{methods}->{$method_name});
129 # all these attribute readers will be bootstrapped
130 # away in the Class::MOP bootstrap section
132 sub name { $_[0]->{'$:package'} }
133 sub get_attribute_map { $_[0]->{'%:attributes'} }
134 sub attribute_metaclass { $_[0]->{'$:attribute_metaclass'} }
135 sub method_metaclass { $_[0]->{'$:method_metaclass'} }
137 # Instance Construction & Cloning
142 # we need to protect the integrity of the
143 # Class::MOP::Class singletons here, so we
144 # delegate this to &construct_class_instance
145 # which will deal with the singletons
146 return $class->construct_class_instance(@_)
147 if $class->name->isa('Class::MOP::Class');
148 bless $class->construct_instance(@_) => $class->name;
151 sub construct_instance {
152 my ($class, %params) = @_;
154 foreach my $attr ($class->compute_all_applicable_attributes()) {
155 my $init_arg = $attr->init_arg();
156 # try to fetch the init arg from the %params ...
158 $val = $params{$init_arg} if exists $params{$init_arg};
159 # if nothing was in the %params, we can use the
160 # attribute's default value (if it has one)
161 $val ||= $attr->default($instance) if $attr->has_default();
162 $instance->{$attr->name} = $val;
169 my $instance = shift;
170 (blessed($instance) && $instance->isa($class->name))
171 || confess "You must pass an instance ($instance) of the metaclass (" . $class->name . ")";
173 # we need to protect the integrity of the
174 # Class::MOP::Class singletons here, they
175 # should not be cloned.
176 return $instance if $instance->isa('Class::MOP::Class');
177 bless $class->clone_instance($instance, @_) => blessed($instance);
181 my ($class, $instance, %params) = @_;
183 || confess "You can only clone instances, \$self is not a blessed instance";
184 my $clone = { %$instance, %params };
190 # &name should be here too, but it is above
191 # because it gets bootstrapped away
196 ${$self->name . '::VERSION'};
206 @{$self->name . '::ISA'} = @supers;
208 @{$self->name . '::ISA'};
211 sub class_precedence_list {
214 # We need to check for ciruclar inheirtance here.
215 # This will do nothing if all is well, and blow
216 # up otherwise. Yes, it's an ugly hack, better
217 # suggestions are welcome.
218 { $self->name->isa('This is a test for circular inheritance') }
219 # ... and no back to our regularly scheduled program
223 $self->initialize($_)->class_precedence_list()
224 } $self->superclasses()
231 my ($self, $method_name, $method) = @_;
232 (defined $method_name && $method_name)
233 || confess "You must define a method name";
234 # use reftype here to allow for blessed subs ...
235 (reftype($method) && reftype($method) eq 'CODE')
236 || confess "Your code block must be a CODE reference";
237 my $full_method_name = ($self->name . '::' . $method_name);
240 no warnings 'redefine';
241 *{$full_method_name} = subname $full_method_name => $method;
245 my ($self, $method_name, $method) = @_;
246 (defined $method_name && $method_name)
247 || confess "You must define a method name";
248 # use reftype here to allow for blessed subs ...
249 (reftype($method) && reftype($method) eq 'CODE')
250 || confess "Your code block must be a CODE reference";
251 my $full_method_name = ($self->name . '::' . $method_name);
254 no warnings 'redefine';
255 *{$full_method_name} = $method;
260 ## private utility functions for has_method
261 my $_find_subroutine_package_name = sub { eval { svref_2object($_[0])->GV->STASH->NAME } || '' };
262 my $_find_subroutine_name = sub { eval { svref_2object($_[0])->GV->NAME } || '' };
265 my ($self, $method_name) = @_;
266 (defined $method_name && $method_name)
267 || confess "You must define a method name";
269 my $sub_name = ($self->name . '::' . $method_name);
272 return 0 if !defined(&{$sub_name});
273 return 0 if $_find_subroutine_package_name->(\&{$sub_name}) ne $self->name &&
274 $_find_subroutine_name->(\&{$sub_name}) ne '__ANON__';
281 my ($self, $method_name) = @_;
282 (defined $method_name && $method_name)
283 || confess "You must define a method name";
286 return \&{$self->name . '::' . $method_name}
287 if $self->has_method($method_name);
288 return; # <- make sure to return undef
292 my ($self, $method_name) = @_;
293 (defined $method_name && $method_name)
294 || confess "You must define a method name";
296 my $removed_method = $self->get_method($method_name);
299 delete ${$self->name . '::'}{$method_name}
300 if defined $removed_method;
302 return $removed_method;
305 sub get_method_list {
308 grep { $self->has_method($_) } %{$self->name . '::'};
311 sub compute_all_applicable_methods {
314 # keep a record of what we have seen
315 # here, this will handle all the
316 # inheritence issues because we are
317 # using the &class_precedence_list
318 my (%seen_class, %seen_method);
319 foreach my $class ($self->class_precedence_list()) {
320 next if $seen_class{$class};
321 $seen_class{$class}++;
322 # fetch the meta-class ...
323 my $meta = $self->initialize($class);
324 foreach my $method_name ($meta->get_method_list()) {
325 next if exists $seen_method{$method_name};
326 $seen_method{$method_name}++;
328 name => $method_name,
330 code => $meta->get_method($method_name)
337 sub find_all_methods_by_name {
338 my ($self, $method_name) = @_;
339 (defined $method_name && $method_name)
340 || confess "You must define a method name to find";
342 # keep a record of what we have seen
343 # here, this will handle all the
344 # inheritence issues because we are
345 # using the &class_precedence_list
347 foreach my $class ($self->class_precedence_list()) {
348 next if $seen_class{$class};
349 $seen_class{$class}++;
350 # fetch the meta-class ...
351 my $meta = $self->initialize($class);;
353 name => $method_name,
355 code => $meta->get_method($method_name)
356 } if $meta->has_method($method_name);
366 # either we have an attribute object already
367 # or we need to create one from the args provided
368 my $attribute = blessed($_[0]) ? $_[0] : $self->attribute_metaclass->new(@_);
369 # make sure it is derived from the correct type though
370 ($attribute->isa('Class::MOP::Attribute'))
371 || confess "Your attribute must be an instance of Class::MOP::Attribute (or a subclass)";
372 $attribute->attach_to_class($self);
373 $attribute->install_accessors();
374 $self->get_attribute_map->{$attribute->name} = $attribute;
378 my ($self, $attribute_name) = @_;
379 (defined $attribute_name && $attribute_name)
380 || confess "You must define an attribute name";
381 exists $self->get_attribute_map->{$attribute_name} ? 1 : 0;
385 my ($self, $attribute_name) = @_;
386 (defined $attribute_name && $attribute_name)
387 || confess "You must define an attribute name";
388 return $self->get_attribute_map->{$attribute_name}
389 if $self->has_attribute($attribute_name);
393 sub remove_attribute {
394 my ($self, $attribute_name) = @_;
395 (defined $attribute_name && $attribute_name)
396 || confess "You must define an attribute name";
397 my $removed_attribute = $self->get_attribute_map->{$attribute_name};
398 return unless defined $removed_attribute;
399 delete $self->get_attribute_map->{$attribute_name};
400 $removed_attribute->remove_accessors();
401 $removed_attribute->detach_from_class();
402 return $removed_attribute;
405 sub get_attribute_list {
407 keys %{$self->get_attribute_map};
410 sub compute_all_applicable_attributes {
413 # keep a record of what we have seen
414 # here, this will handle all the
415 # inheritence issues because we are
416 # using the &class_precedence_list
417 my (%seen_class, %seen_attr);
418 foreach my $class ($self->class_precedence_list()) {
419 next if $seen_class{$class};
420 $seen_class{$class}++;
421 # fetch the meta-class ...
422 my $meta = $self->initialize($class);
423 foreach my $attr_name ($meta->get_attribute_list()) {
424 next if exists $seen_attr{$attr_name};
425 $seen_attr{$attr_name}++;
426 push @attrs => $meta->get_attribute($attr_name);
434 sub add_package_variable {
435 my ($self, $variable, $initial_value) = @_;
436 (defined $variable && $variable =~ /^[\$\@\%]/)
437 || confess "variable name does not have a sigil";
439 my ($sigil, $name) = ($variable =~ /^(.)(.*)$/);
440 if (defined $initial_value) {
442 *{$self->name . '::' . $name} = $initial_value;
445 eval $sigil . $self->name . '::' . $name;
446 confess "Could not create package variable ($variable) because : $@" if $@;
450 sub has_package_variable {
451 my ($self, $variable) = @_;
452 (defined $variable && $variable =~ /^[\$\@\%]/)
453 || confess "variable name does not have a sigil";
454 my ($sigil, $name) = ($variable =~ /^(.)(.*)$/);
456 defined ${$self->name . '::'}{$name} ? 1 : 0;
459 sub get_package_variable {
460 my ($self, $variable) = @_;
461 (defined $variable && $variable =~ /^[\$\@\%]/)
462 || confess "variable name does not have a sigil";
463 my ($sigil, $name) = ($variable =~ /^(.)(.*)$/);
465 # try to fetch it first,.. see what happens
466 my $ref = eval '\\' . $sigil . $self->name . '::' . $name;
467 confess "Could not get the package variable ($variable) because : $@" if $@;
468 # if we didn't die, then we can return it
472 sub remove_package_variable {
473 my ($self, $variable) = @_;
474 (defined $variable && $variable =~ /^[\$\@\%]/)
475 || confess "variable name does not have a sigil";
476 my ($sigil, $name) = ($variable =~ /^(.)(.*)$/);
478 delete ${$self->name . '::'}{$name};
489 Class::MOP::Class - Class Meta Object
493 # use this for introspection ...
495 # add a method to Foo ...
496 Foo->meta->add_method('bar' => sub { ... })
498 # get a list of all the classes searched
499 # the method dispatcher in the correct order
500 Foo->meta->class_precedence_list()
502 # remove a method from Foo
503 Foo->meta->remove_method('bar');
505 # or use this to actually create classes ...
507 Class::MOP::Class->create('Bar' => '0.01' => (
508 superclasses => [ 'Foo' ],
510 Class::MOP:::Attribute->new('$bar'),
511 Class::MOP:::Attribute->new('$baz'),
514 calculate_bar => sub { ... },
515 construct_baz => sub { ... }
521 This is the largest and currently most complex part of the Perl 5
522 meta-object protocol. It controls the introspection and
523 manipulation of Perl 5 classes (and it can create them too). The
524 best way to understand what this module can do, is to read the
525 documentation for each of it's methods.
529 =head2 Self Introspection
535 This will return a B<Class::MOP::Class> instance which is related
536 to this class. Thereby allowing B<Class::MOP::Class> to actually
539 As with B<Class::MOP::Attribute>, B<Class::MOP> will actually
540 bootstrap this module by installing a number of attribute meta-objects
541 into it's metaclass. This will allow this class to reap all the benifits
542 of the MOP when subclassing it.
546 =head2 Class construction
548 These methods will handle creating B<Class::MOP::Class> objects,
549 which can be used to both create new classes, and analyze
550 pre-existing classes.
552 This module will internally store references to all the instances
553 you create with these methods, so that they do not need to be
554 created any more than nessecary. Basically, they are singletons.
558 =item B<create ($package_name, ?$package_version,
559 superclasses =E<gt> ?@superclasses,
560 methods =E<gt> ?%methods,
561 attributes =E<gt> ?%attributes)>
563 This returns a B<Class::MOP::Class> object, bringing the specified
564 C<$package_name> into existence and adding any of the
565 C<$package_version>, C<@superclasses>, C<%methods> and C<%attributes>
568 =item B<initialize ($package_name)>
570 This initializes and returns returns a B<Class::MOP::Class> object
571 for a given a C<$package_name>.
573 =item B<construct_class_instance (%options)>
575 This will construct an instance of B<Class::MOP::Class>, it is
576 here so that we can actually "tie the knot" for B<Class::MOP::Class>
577 to use C<construct_instance> once all the bootstrapping is done. This
578 method is used internally by C<initialize> and should never be called
579 from outside of that method really.
581 =item B<check_metaclass_compatability>
583 This method is called as the very last thing in the
584 C<construct_class_instance> method. This will check that the
585 metaclass you are creating is compatible with the metaclasses of all
586 your ancestors. For more inforamtion about metaclass compatibility
587 see the C<About Metaclass compatibility> section in L<Class::MOP>.
591 =head2 Object instance construction and cloning
593 These methods are B<entirely optional>, it is up to you whether you want
598 =item B<new_object (%params)>
600 This is a convience method for creating a new object of the class, and
601 blessing it into the appropriate package as well. Ideally your class
602 would call a C<new> this method like so:
605 my ($class, %param) = @_;
606 $class->meta->new_object(%params);
609 Of course the ideal place for this would actually be in C<UNIVERSAL::>
610 but that is considered bad style, so we do not do that.
612 =item B<construct_instance (%params)>
614 This method is used to construct an instace structure suitable for
615 C<bless>-ing into your package of choice. It works in conjunction
616 with the Attribute protocol to collect all applicable attributes.
618 This will construct and instance using a HASH ref as storage
619 (currently only HASH references are supported). This will collect all
620 the applicable attributes and layout out the fields in the HASH ref,
621 it will then initialize them using either use the corresponding key
622 in C<%params> or any default value or initializer found in the
623 attribute meta-object.
625 =item B<clone_object ($instance, %params)>
627 This is a convience method for cloning an object instance, then
628 blessing it into the appropriate package. This method will call
629 C<clone_instance>, which performs a shallow copy of the object,
630 see that methods documentation for more details. Ideally your
631 class would call a C<clone> this method like so:
634 my ($self, %param) = @_;
635 $self->meta->clone_object($self, %params);
638 Of course the ideal place for this would actually be in C<UNIVERSAL::>
639 but that is considered bad style, so we do not do that.
641 =item B<clone_instance($instance, %params)>
643 This method is a compliment of C<construct_instance> (which means if
644 you override C<construct_instance>, you need to override this one too),
645 and clones the instance shallowly.
647 The cloned structure returned is (like with C<construct_instance>) an
648 unC<bless>ed HASH reference, it is your responsibility to then bless
649 this cloned structure into the right class (which C<clone_object> will
652 As of 0.11, this method will clone the C<$instance> structure shallowly,
653 as opposed to the deep cloning implemented in prior versions. After much
654 thought, research and discussion, I have decided that anything but basic
655 shallow cloning is outside the scope of the meta-object protocol. I
656 think Yuval "nothingmuch" Kogman put it best when he said that cloning
657 is too I<context-specific> to be part of the MOP.
667 This is a read-only attribute which returns the package name for the
668 given B<Class::MOP::Class> instance.
672 This is a read-only attribute which returns the C<$VERSION> of the
673 package for the given B<Class::MOP::Class> instance.
677 =head2 Inheritance Relationships
681 =item B<superclasses (?@superclasses)>
683 This is a read-write attribute which represents the superclass
684 relationships of the class the B<Class::MOP::Class> instance is
685 associated with. Basically, it can get and set the C<@ISA> for you.
688 Perl will occasionally perform some C<@ISA> and method caching, if
689 you decide to change your superclass relationship at runtime (which
690 is quite insane and very much not recommened), then you should be
691 aware of this and the fact that this module does not make any
692 attempt to address this issue.
694 =item B<class_precedence_list>
696 This computes the a list of all the class's ancestors in the same order
697 in which method dispatch will be done. This is similair to
698 what B<Class::ISA::super_path> does, but we don't remove duplicate names.
706 =item B<method_metaclass>
708 =item B<add_method ($method_name, $method)>
710 This will take a C<$method_name> and CODE reference to that
711 C<$method> and install it into the class's package.
714 This does absolutely nothing special to C<$method>
715 other than use B<Sub::Name> to make sure it is tagged with the
716 correct name, and therefore show up correctly in stack traces and
719 =item B<alias_method ($method_name, $method)>
721 This will take a C<$method_name> and CODE reference to that
722 C<$method> and alias the method into the class's package.
725 Unlike C<add_method>, this will B<not> try to name the
726 C<$method> using B<Sub::Name>, it only aliases the method in
729 =item B<has_method ($method_name)>
731 This just provides a simple way to check if the class implements
732 a specific C<$method_name>. It will I<not> however, attempt to check
733 if the class inherits the method (use C<UNIVERSAL::can> for that).
735 This will correctly handle functions defined outside of the package
736 that use a fully qualified name (C<sub Package::name { ... }>).
738 This will correctly handle functions renamed with B<Sub::Name> and
739 installed using the symbol tables. However, if you are naming the
740 subroutine outside of the package scope, you must use the fully
741 qualified name, including the package name, for C<has_method> to
742 correctly identify it.
744 This will attempt to correctly ignore functions imported from other
745 packages using B<Exporter>. It breaks down if the function imported
746 is an C<__ANON__> sub (such as with C<use constant>), which very well
747 may be a valid method being applied to the class.
749 In short, this method cannot always be trusted to determine if the
750 C<$method_name> is actually a method. However, it will DWIM about
751 90% of the time, so it's a small trade off I think.
753 =item B<get_method ($method_name)>
755 This will return a CODE reference of the specified C<$method_name>,
756 or return undef if that method does not exist.
758 =item B<remove_method ($method_name)>
760 This will attempt to remove a given C<$method_name> from the class.
761 It will return the CODE reference that it has removed, and will
762 attempt to use B<Sub::Name> to clear the methods associated name.
764 =item B<get_method_list>
766 This will return a list of method names for all I<locally> defined
767 methods. It does B<not> provide a list of all applicable methods,
768 including any inherited ones. If you want a list of all applicable
769 methods, use the C<compute_all_applicable_methods> method.
771 =item B<compute_all_applicable_methods>
773 This will return a list of all the methods names this class will
774 respond to, taking into account inheritance. The list will be a list of
775 HASH references, each one containing the following information; method
776 name, the name of the class in which the method lives and a CODE
777 reference for the actual method.
779 =item B<find_all_methods_by_name ($method_name)>
781 This will traverse the inheritence hierarchy and locate all methods
782 with a given C<$method_name>. Similar to
783 C<compute_all_applicable_methods> it returns a list of HASH references
784 with the following information; method name (which will always be the
785 same as C<$method_name>), the name of the class in which the method
786 lives and a CODE reference for the actual method.
788 The list of methods produced is a distinct list, meaning there are no
789 duplicates in it. This is especially useful for things like object
790 initialization and destruction where you only want the method called
791 once, and in the correct order.
797 It should be noted that since there is no one consistent way to define
798 the attributes of a class in Perl 5. These methods can only work with
799 the information given, and can not easily discover information on
800 their own. See L<Class::MOP::Attribute> for more details.
804 =item B<attribute_metaclass>
806 =item B<get_attribute_map>
808 =item B<add_attribute ($attribute_name, $attribute_meta_object)>
810 This stores a C<$attribute_meta_object> in the B<Class::MOP::Class>
811 instance associated with the given class, and associates it with
812 the C<$attribute_name>. Unlike methods, attributes within the MOP
813 are stored as meta-information only. They will be used later to
814 construct instances from (see C<construct_instance> above).
815 More details about the attribute meta-objects can be found in the
816 L<Class::MOP::Attribute> or the L<Class::MOP/The Attribute protocol>
819 It should be noted that any accessor, reader/writer or predicate
820 methods which the C<$attribute_meta_object> has will be installed
821 into the class at this time.
823 =item B<has_attribute ($attribute_name)>
825 Checks to see if this class has an attribute by the name of
826 C<$attribute_name> and returns a boolean.
828 =item B<get_attribute ($attribute_name)>
830 Returns the attribute meta-object associated with C<$attribute_name>,
831 if none is found, it will return undef.
833 =item B<remove_attribute ($attribute_name)>
835 This will remove the attribute meta-object stored at
836 C<$attribute_name>, then return the removed attribute meta-object.
839 Removing an attribute will only affect future instances of
840 the class, it will not make any attempt to remove the attribute from
841 any existing instances of the class.
843 It should be noted that any accessor, reader/writer or predicate
844 methods which the attribute meta-object stored at C<$attribute_name>
845 has will be removed from the class at this time. This B<will> make
846 these attributes somewhat inaccessable in previously created
847 instances. But if you are crazy enough to do this at runtime, then
848 you are crazy enough to deal with something like this :).
850 =item B<get_attribute_list>
852 This returns a list of attribute names which are defined in the local
853 class. If you want a list of all applicable attributes for a class,
854 use the C<compute_all_applicable_attributes> method.
856 =item B<compute_all_applicable_attributes>
858 This will traverse the inheritance heirachy and return a list of all
859 the applicable attributes for this class. It does not construct a
860 HASH reference like C<compute_all_applicable_methods> because all
861 that same information is discoverable through the attribute
866 =head2 Package Variables
868 Since Perl's classes are built atop the Perl package system, it is
869 fairly common to use package scoped variables for things like static
870 class variables. The following methods are convience methods for
871 the creation and inspection of package scoped variables.
875 =item B<add_package_variable ($variable_name, ?$initial_value)>
877 Given a C<$variable_name>, which must contain a leading sigil, this
878 method will create that variable within the package which houses the
879 class. It also takes an optional C<$initial_value>, which must be a
880 reference of the same type as the sigil of the C<$variable_name>
883 =item B<get_package_variable ($variable_name)>
885 This will return a reference to the package variable in
888 =item B<has_package_variable ($variable_name)>
890 Returns true (C<1>) if there is a package variable defined for
891 C<$variable_name>, and false (C<0>) otherwise.
893 =item B<remove_package_variable ($variable_name)>
895 This will attempt to remove the package variable at C<$variable_name>.
901 Stevan Little E<lt>stevan@iinteractive.comE<gt>
903 =head1 COPYRIGHT AND LICENSE
905 Copyright 2006 by Infinity Interactive, Inc.
907 L<http://www.iinteractive.com>
909 This library is free software; you can redistribute it and/or modify
910 it under the same terms as Perl itself.