Data::InputMonster::Util - handy routines for use with the input monster


Data-InputMonster documentation  | view source Contained in the Data-InputMonster distribution.

Index


NAME

Top

Data::InputMonster::Util - handy routines for use with the input monster

VERSION

Top

version 0.008

DESCRIPTION

Top

These methods, which provide some helpers for use with InputMonster, can be exported as routines upon request.

METHODS

Top

dig

    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.

For example, given:

    $input  = [ { ... }, { ... }, { foo => [ { bar => 13, baz => undef } ] } ];
    $source = dig( [ qw( 2 foo 0 bar ) ] );

The source would find 13.

AUTHOR

Top

  Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


Data-InputMonster documentation  | view source Contained in the Data-InputMonster distribution.