NAME

Hash::Util::Exists::Tiny - Some hash helper functions related to perl's "exists" function.

VERSION

Version 1.03

SYNOPSIS

use Hash::Util::Exists::Tiny qw(exists_one_of
                                list_exists  list_exists_unique
                                num_exists   num_exists_unique
                                defined_one_of
                                list_defined list_defined_unique
                                num_defined  num_defined_unique
                                );

or

use Hash::Util::Exists::Tiny qw(:all);

DESCRIPTION

This module provides some funtions for hashes, related to perl's exists function. All functions are exported on demand, you can use tag :all to export all functions at once.

The functions do not perform parameter checks.

FUNCTIONS

exists_one_of HASH_REF [, LIST]

Returns true if one of the elements in LIST is a key in HASH_REF, otherwise false. Example:

my $flag = exists_one_of($href, qw(foo bar baz));
list_exists HASH_REF [, LIST]

Returns the list of entries of LIST that are keys in HASH_REF. Note that duplicate keys in LIST are also duplicate in the result.

list_exists_unique HASH_REF [, LIST]

Like list_exists, but each duplicated element is only counted once.

num_exists HASH_REF [, LIST]

Returns the number of entries in LIST that are keys in HASH_REF. Note that duplicate entries are counted twice.

num_exists_unique HASH_REF [, LIST]

Like num_exists, but each duplicated element is only counted once.

defined_one_of HASH_REF [, LIST]

Like exists_one_of, but looks for defined values.

list_defined HASH_REF [, LIST]

Like list_exists, but looks for defined values.

list_defined_unique HASH_REF [, LIST]

Like list_exists_unique, but looks for defined values.

num_defined HASH_REF [, LIST]

Like num_exists, but looks for defined values.

num_defined_unique HASH_REF [, LIST]

Like num_exists_unique, but looks for defined values.

AUTHOR

Abdul al Hazred, <451 at gmx.eu>

BUGS

Please report any bugs or feature requests to bug-hash-util-exists-tiny at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Hash-Util-Exists-Tiny. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SEE ALSO

Exporter

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Hash::Util::Exists::Tiny

You can also look for information at:

LICENSE AND COPYRIGHT

This software is Copyright (c) 2021 by Abdul al Hazred.

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