Data::Taxonomy::Tags - Represents a set of tags for any item
use Data::Taxonomy::Tags; my $tags = Data::Taxonomy::Tags->new('perl tags cpan module system:meta'); print $_, "\n" for $tags->tags; print $_, "\n" for $tags->categories;
Data::Taxonomy::Tags will basically take care of managing tags for an item easier. You provide it with a string of tags and it'll allow you to call methods to get all the tags and categories as well as add and delete tags from the list.
The first argument is a string of tags. This string is stripped of any leading and trailing whitespace. The second argument, which is optional, is a hashref of options.
Returns a Data::Taxonomy::Tags object;
separator => ['\s+', ' ']
Specifies the regex pattern (or compiled regex) which will be used to split the tags apart and the character(s) used between tags when converting the object back to a string. Make sure to escape any special characters in the regex pattern.
split
If the value is not an arrayref, then the same value is used for both operations (and is escaped for the regex).
Defaults to ['\s+', ' '].
['\s+', ' ']
category => [':', ':']
Specifies the regex pattern (or compiled regex) which will be used to split the tag name from it's optional category and the character(s) used between the category and tag when converting to a string. Make sure to escape any special characters in the regex pattern.
Defaults to [':', ':'].
[':', ':']
Returns an array or arrayref (depending on context) of Data::Taxonomy::Tags::Tag objects.
Processes the string and adds the tag(s) to the object.
Processes the string and removes the tag(s) from the object.
Removes all tags with the specified category.
Returns an array or arrayref (depending on context) of the unique categories.
Returns an array or arrayref (depending on context) of the tags with the specified category
Returns the tag list as a string (that is, what was given to the constructor). Overloading is used as well to automatically call this method if the object is used in a string context.
All bugs, open and resolved, are handled by RT at https://rt.cpan.org/NoAuth/Bugs.html?Dist=Data-Taxonomy-Tags.
Please report all bugs via https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Data-Taxonomy-Tags.
Copyright 2005, Thomas R. Sibley.
You may use, modify, and distribute this package under the same terms as Perl itself.
Thomas R. Sibley, http://zulutango.org:82/
To install Data::Taxonomy::Tags, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Taxonomy::Tags
CPAN shell
perl -MCPAN -e shell install Data::Taxonomy::Tags
For more information on module installation, please visit the detailed CPAN module installation guide.