View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Tom Wyant > Astro-App-Satpass2 > Astro::App::Satpass2::Copier



Annotate this POD


Open  0
View/Report Bugs
Module Version: 0.035   Source  


Astro::App::Satpass2::Copier - Object copying functionality for Astro::App::Satpass2


 package Astro::App::Satpass2::Foo;
 use strict;
 use warnings;
 use parent qw{ Astro::App::Satpass2::Copier };
 sub new { ... }
 sub attribute_names {
     return ( qw{ bar baz } );


This class is private to the Astro::App::Satpass2 package. The author reserves the right to modify it in any way or retract it without prior notice.


This class supports the following public methods:

Accessors and Mutators


 $obj->warner( undef );
 my $warner = $obj->warner();

This method is both accessor and mutator for the warner attribute.

If an argument is passed, it must be either an Astro::App::Satpass2::Warner (either class or object), or undef (which causes a new Astro::App::Satpass2::Warner object to be created.)

If no argument is passed, it is an accessor, returning the warner object. If no such object has been assigned, one will be generated.


 print join( ', ', $obj->attribute_names() ), "\n";

This method returns the names of the object's attribute_names.

Subclasses should override this. Immediate subclasses should call SUPER::attribute_names(), and indirect subclasses must call SUPER::attribute_names(). A subclass' override would look something like this:

 sub attribute_names {
     my ( $self ) = @_;
     return ( $self->SUPER::attribute_names(), qw{ foo bar baz } );


 say 'I am a ', $obj->class_name_of_record();

This method returns the class name of record of the object. By default this is simply the name of the object's class (i.e. ref $obj, but subclasses can override this to hide implementation details.


 my $clone = $obj->clone();

This method returns a clone of the original object, taken using Clone::clone().

Overrides may call SUPER::clone(). If they do not they bear complete responsibility for producing a correct clone of the original object.


 $obj->copy( $copy, %skip );

This method copies the attribute values of the original object into the attribute_names of the copy object. The original object is returned.

The %skip hash is optional. Any attribute that appears in the %skip hash is skipped. Note that you can also pass an array here provided it has an even number of elements; the even-numbered elements (from zero) will be taken as the attribute names.

The copy object need not be the same class as the original, but it must support all attributes the original supports.



This method may be called exactly once by the subclass to create accessor/mutator methods. This method assumes that the object is based on a hash reference, and stores attribute values in same-named keys in the hash. The created methods have the same names as the attributes. They are accessors if called without arguments, and mutators returning the original object if called with arguments. Methods already in existence when this method is called will not be overridden.


 $obj->init( name => value ... );

This method sets multiple attributes. It dies if any of the names does not represent a legal attribute name. It returns the invocant.

Other Methods


 $self->wail( 'Something bad happened' );

This convenience method simply wraps $self->warner()->wail().


 $self->weep( 'Something really horrible happened' );

This convenience method simply wraps $self->warner()->weep().


 $self->whinge( 'Something annoying happened' );

This convenience method simply wraps $self->warner()->whinge().


Support is by the author. Please file bug reports at, or in electronic mail to the author.


Thomas R. Wyant, III wyant at cpan dot org


Copyright (C) 2010-2018 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For more details, see the full text of the licenses in the directory LICENSES.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.

syntax highlighting: