List::Util::Find - List utilities related to finding items
This document describes version 0.001 of List::Util::Find (from Perl distribution List-Util-Find), released on 2021-05-26.
use List::Util::Find qw(hasnum hasstr); my @ary = (1,3,"foo",7,2,"bar",10,"baz"); if (hasnum 3, @ary) { ... } if (hasstr "baz", @ary) { ... }
Experimental.
Not exported by default but exportable.
Usage:
hasnum $num, ...
Like grep { $_ == $num } ... except: 1) it makes sure undef does not match; 2) it makes sure non-numeric scalars does not match when $num is zero.
grep { $_ == $num } ...
undef
$num
Please visit the project's homepage at https://metacpan.org/release/List-Util-Find.
Source repository is at https://github.com/perlancar/perl-List-Util-Find.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=List-Util-Find
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
List::Util
perlancar <perlancar@cpan.org>
This software is copyright (c) 2021 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install List::Util::Find, copy and paste the appropriate command in to your terminal.
cpanm
cpanm List::Util::Find
CPAN shell
perl -MCPAN -e shell install List::Util::Find
For more information on module installation, please visit the detailed CPAN module installation guide.