Data::...ilters(3pm)
π Data::DPath::Filters β wait bestie, the manual name is literally Data::...ilters(3pm) π
Okay so like. This is the User Contributed Perl Documentation for Data::DPath::Filters, and it's giving "tiny module, unhinged amounts of power" energy. These are the magic functions you get to use inside filter conditions. Yes. Inside. The. Filter. Conditions. β¨
πΈ NAME πΈ
Data::DPath::Filters β the magic functions available inside filter conditions. That's it, that's the whole vibe. π¦
π API METHODS π
π affe
Mysterious test function. It will vanish. Soon. Or... will it really? No. Probably not. I like it. :-)
Returns true if the value eq "affe". That's the whole thing. Iconic, honestly. No cap. π
π₯ 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. So like, don't come for me when your indices are chaos β it's literally documented. π
π size
Returns the size of the current element. Here's the breakdown, bestie:
- If it is an array ref β it returns the number of elements
- If it is a hash ref β it returns the number of keys
- If it is a scalar β it returns
1 - Everything else β it returns
-1
Simple. Clean. Slay. β¨
π key
If it is a hashref, returns the key under which the current element is associated as value. Else it returns undef.
This gives the key() function kind of a "look back" behaviour, because the associated point is already after that key. Yes bestie, it's looking backwards. Main character energy fr fr. π
π value
Returns the value of the current element. Short, sweet, does exactly what it says. We love a low-effort legend. π«Ά
π§ isa
Frontend to UNIVERSAL::isa. True if the current element is_a given class.
π¦ reftype
Frontend to Scalar::Util::reftype.
Returns Scalar::Util::reftype of current element $_. With this you can do comparison by yourself with eq, =~, ~~ or whatever in filter expressions. You're the boss of your own comparisons, periodt. π
β is_reftype($EXPECTED_TYPE)
Frontend to Scalar::Util::reftype.
Checks whether Scalar::Util::reftype of current element $_ equals the provided argument $EXPECTED_TYPE and returns true/false. Yes it's just the previous one but with the comparison done for you. Convenience queen. π
π AUTHOR π
Steffen Schwigon <ss5@renormalist.net>
πΈ COPYRIGHT AND LICENSE πΈ
This software is copyright (c) 2024 by Steffen Schwigon.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
And that's the whole page, bestie!! π Written for perl v5.40.0, dated 2024-10-05, straight from the Data::...ilters(3pm) corner of the User Contributed Perl Documentation. Go forth and filter, you absolute icon. πβ¨π«Ά
π¦ where this page comes from
- ubuntu resolute: libdata-dpath-perl 0.60-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdata-dpath-perl 0.60-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms