Struct::Path::PerlStyle - Perl-style syntax frontend for Struct::Path.
Version 0.64
use Struct::Path::PerlStyle qw(ps_parse ps_serialize); $struct = ps_parse('{a}{b}[1]'); # string to Struct::Path path $string = ps_serialize($struct); # Struct::Path path to string
Nothing is exported by default.
Examples:
'{a}{b}' # points to b's value '{a}{}' # all values from a's subhash; same for arrays (using empty square brackets) '{a}{b,c}' # b's and c's values '{a}{b c}' # same, space also is a delimiter '{a}{"space inside"}' # key must be quoted unless it is a simple word (single quotes supported as well) '{a}{"multi\nline"}' # same for special characters (if double quoted) '{a}{"π"}' # keys containing non ASCII characters also must be quoted* '{a}{/regexp/}' # regexp keys match '{a}{b}[0,1,2,5]' # 0, 1, 2 and 5 array's items '{a}{b}[0..2,5]' # same, but using ranges '{a}{b}[9..0]' # descending ranges allowed (perl doesn't) '{a}{b}(back){c}' # step back (to previous level) * at least until https://github.com/adamkennedy/PPI/issues/168
Parse perl-style string to Struct::Path path
$struct_path = ps_parse($string);
Serialize Struct::Path path to perl-style string
$string = ps_serialize($struct_path);
Michael Samoglyadov, <mixas at cpan.org>
<mixas at cpan.org>
Please report any bugs or feature requests to bug-struct-path-native at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Struct-Path-PerlStyle. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-struct-path-native at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Struct::Path::PerlStyle
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Struct-Path-PerlStyle
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Struct-Path-PerlStyle
CPAN Ratings
http://cpanratings.perl.org/d/Struct-Path-PerlStyle
Search CPAN
http://search.cpan.org/dist/Struct-Path-PerlStyle/
Struct::Path, Struct::Diff, perldsc, perldata
Copyright 2016,2017 Michael Samoglyadov.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Struct::Path::PerlStyle, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Struct::Path::PerlStyle
CPAN shell
perl -MCPAN -e shell install Struct::Path::PerlStyle
For more information on module installation, please visit the detailed CPAN module installation guide.