25 Mar 2010 21:01:54 UTC
- Distribution: Data-Container
- Module version: 1.100840
- Source (raw)
- Browse (raw)
- How to Contribute
- Clone repository
- Issues (0)
- Testers (1449 / 0 / 0)
- KwaliteeBus factor: 0
- 88.89% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity24 month
- Download (16.91KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userMARCEL Marcel Grünauer
- BUGS AND LIMITATIONS
- COPYRIGHT AND LICENSE
Data::Container - Base class for objects containing a list of items
package My::Container; use parent 'Data::Container'; # ... package main; my $container = My::Container->new; $container->items_push('some_item');
This class implements a container object. The container can contain any object, scalar or reference you like. Typically you would subclass Data::Container and implement custom methods for your specific container.
When the container is stringified, it returns the concatenated stringifications of its items, each two items joined by two newlines.
items_push(), and it also takes a list of items to push into the container, but it doesn't push any items that are already in the container (items are compared deeply to determine equality).
Given a package name, it returns those items from the container whose
ref()is equal to that package name.
For example, your container could contain some items of type
My::Item::Fooand some of type
My::Item::Bar. If you only want a list of the items of type
My::Item::Foo, you could use:
my @foo_items = $container->item_grep('My::Item::Foo');
Stringifies the data container by concatenating the items together, separated by an empty line.
Adds support for Data::Comparable by autovivifying the container items array.
See perlmodinstall for information and options on installing Perl modules.
No bugs have been reported.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=Data-Container.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Data-Container/.
The development version lives at http://github.com/hanekomu/Data-Container/. Instead of sending patches, please fork this project using the standard git and github infrastructure.
Marcel Gruenauer <email@example.com>
This software is copyright (c) 2004 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Data::Container, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Data::Container
For more information on module installation, please visit the detailed CPAN module installation guide.