View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Gianni Ceccarelli > Data-MultiValued-0.0.1_4 > Data::MultiValued::TagContainer



Annotate this POD

Module Version: 0.0.1_4   Source  


Data::MultiValued::TagContainer - container for tagged values


version 0.0.1_4


Please don't use this module directly, use Data::MultiValued::Tags.

This module implements the storage for tagged data. It's almost exactly a hash, the main difference being that undef is a valid key and it's distinct from the empty string.

Another difference is that you get an exception if you try to access a tag that's not there.

Data is kept in "storage cells", as created by "_create_new_inferior" (by default, a hashref).



  my $value = $obj->get({ tag => $the_tag });

Retrieves the "storage cell" for the given tag. Throws a Data::MultiValued::Exceptions::TagNotFound exception if the tag does not exists in this object.

Not passing in a tag is equivalent to passing in tag => undef.


  $obj->get_or_create({ tag => $the_tag });

Retrieves the "storage cell" for the given tag. If the tag does not exist, creates a new cell (see "_create_new_inferior"), sets it for the tag, and returns it.

Not passing in a tag is equivalent to passing in tag => undef.


  $obj->clear({ tag => $the_tag });

Deletes the given tag and all data associated with it. Does not throw exceptions: if the tag does not exist, nothing happens.

Not passing in a tag, or passing tag => undef, clears everything. If you want to only clear the undef tag, you may call _clear_default_tag (which is considered a "protected" method).


  my @tags = $obj->all_tags;

Returns all the tags defined in this object. Does not return the undef tag.


Returns a new "storage cell", by default an empty hashref. See Data::MultiValued::TagContainerForRanges for an example of use.


Gianni Ceccarelli <>


This software is copyright (c) 2011 by

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: