NAME

Data::DPath::Filters - Magic functions available inside filter conditions

API METHODS

affe

Mysterious test function. Will vanish. Soon. Or will it really? No, probably not. I like it. :-)

Returns true if the value eq "affe".

idx

Returns the current index inside array elements.

Please note that the current matching elements might not be in a defined order if resulting from anything else than arrays.

size

Returns the size of the current element. If it is a hash ref it returns number of elements, if hashref it returns number of keys, if scalar it returns 1, everything else returns -1.

key

Returns the key of the current element if it is a hashref. Else it returns undef.

value

Returns the value of the current element. If it is a hashref return the value. If a scalar return the scalar. Else return undef.

isa

Frontend to UNIVERSAL::isa. True if the current elemt is_a given class.

reftype

Frontend to Scalar::Util::reftype.

If argument given it checks whether reftype($_) equals the argument and returns true/false.

If no argument is given it returns reftype of current element $_ and you can do comparison by yourself with eq, =~, ~~ or whatever.

AUTHOR

Steffen Schwigon, <schwigon at cpan.org>

COPYRIGHT & LICENSE

Copyright 2008,2009 Steffen Schwigon.

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