Data::...h::Path(3pm)

๐Ÿ“ฆ
version 0.60 ยท 5 versions
, in ubuntu resolute, ubuntu stonking

๐Ÿ’– Data::DPath::Path โ€” the manual, but make it make sense ๐Ÿ’–

okay so bestie, you found Data::DPath::Path(3pm) and honestly? good for you. this is a Perl thing, from the User Contributed Perl Documentation, and it's literally the class that turns a DPath string into a thing you can actually use. let's go ๐Ÿฆ‹


โœจ NAME โœจ

Data::DPath::Path โ€” an abstraction for a DPath. periodt.


๐ŸŒธ ABOUT ๐ŸŒธ

so here's the vibe: you hand it a string description, it parses that string, and then it gives you frontend methods to play with. that's it, that's the whole personality. parse and serve ๐Ÿ’…


๐ŸŽ€ PUBLIC METHODS ๐ŸŽ€

new ( %args )

the constructor, babes. it creates the instance. slay.

Args:

  • give_references โ€” default is 0. if you set it to a true value, then the results you get back are references to the matched points in the data structure. not copies. references. iykyk ๐Ÿ”ฅ

match( $data )

returns an array of all the values in $data that match the Path object. all of them. the whole squad. ๐Ÿ’–

matchr( $data )

same energy as match, but it returns an array ref of all the values in $data that match the Path object. the r is for ref, bestie, it's giving consistency โœจ


๐Ÿ”ฎ INTERNAL METHODS ๐Ÿ”ฎ

ngl these are the backstage crew. don't touch them unless you know what you're doing, fr fr.

op_match( $self, $data )

this sub/method is bound as the overloading function for ~~. yes, the smartmatch operator. iconic.

quoted

checks whether a path part starts with quotes. that's the whole job. ๐ŸŽ€

unquote

removes surrounding quotes. bye girl ๐Ÿ‘‹

unescape

converts backslashed characters into their non-backslashed form. the backslashes simply had to go ๐Ÿ’…

_build__steps

okay this one is the one. this method is essentially the DPath parser, because it tokenizes the path into single steps, and the later execution of those steps is the base functionality of the whole DPath module. main character energy, no cap ๐Ÿ‘‘

path

attribute / accessor. simple as that.

_steps

attribute / accessor. also simple. also iconic.

give_references

attribute / accessor. yeah, the same one from the constructor. she contains multitudes ๐Ÿ’œ


๐ŸŒˆ aliased classes ๐ŸŒˆ

this is just to make Pod::Coverage happy, because Pod::Coverage does not handle aliased modules. so we list them here and everyone can chill ๐Ÿ™ˆ

  • Context
  • Point
  • Step

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Steffen Schwigon <ss5@renormalist.net>


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. so like, go off, but responsibly ๐Ÿซถ


and that's the whole page, bestie!! ๐ŸŒธ๐Ÿฆ‹โœจ this was perl v5.40.0, dated 2024-10-05, from the Data::...h::Path(3pm) page in the User Contributed Perl Documentation โ€” mwah, slay, bye ๐Ÿ’–๐Ÿ’…

๐Ÿ“ฆ where this page comes from