Software::Packager::Object is a generic object data storage.
SYNOPSIS
use Software::Packager::Object;
This module is used by Software::Packager for holding data for a each item added to the a software package. It provides an easy way of accessing the data for each object to be installed. This module is designed to be easly sub classed and / or extended.
SUB-CLASSING
To extend or sub-class this module create a new module along the lines of
package Foo;
use Software::Packager::Object;
use vars qw(@ISA);
@ISA = qw( Software::Packager::Object );
########################
# _check_data we don't care about anything other that DESTINATION and FOO_DATA;
sub _check_data
{
my $self = shift;
my Úta = @_;
return undef unless $self->{'DESTINATION'};
return undef unless $self->{'FOO_DATA'};
# now set the data for the object
foreach my $key (keys Úta)
{
my $function = lc $key;
return undef unless $self->$function($data{$key});
}
}
########################
# foo_data returns the foo value fo this object.
sub foo_data
{
my $self = shift;
return $self->{'FOO_DATA'};
}
1;
__END__
Of course I would have created the module with a package of Software::Packager::Object::Foo but that's you choice.
Product's homepage
Requirements:
· Perl