Data::InputMonster::Util - handy routines for use with the input monster
version 0.011
These methods, which provide some helpers for use with InputMonster, can be exported as routines upon request.
This code is effectively abandonware. Although releases will sometimes be made to update contact info or to fix packaging flaws, bug reports will mostly be ignored. Feature requests are even more likely to be ignored. (If someone takes up maintenance of this code, they will presumably remove this notice.)
my $source = dig( [ $key1, $key2, $key2 ]); my $source = dig( sub { ... } );
A dig source looks through the input using the given locator. If it's a coderef, the code is called and passed the input. If it's an arrayref, each entry is used, in turn, to subscript the input as a deep data structure. If it's a plain scalar, it's treated like a one-element arrayref would have been.
dig
For example, given:
$input = [ { ... }, { ... }, { foo => [ { bar => 13, baz => undef } ] } ]; $source = dig( [ qw( 2 foo 0 bar ) ] );
The source would find 13.
Ricardo SIGNES <rjbs@semiotic.systems>
This software is copyright (c) 2021 by Ricardo SIGNES.
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 Data::InputMonster, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::InputMonster
CPAN shell
perl -MCPAN -e shell install Data::InputMonster
For more information on module installation, please visit the detailed CPAN module installation guide.