Data::Zipper::API
package Person; use Moose; has name => ( is => 'ro' ); package MyApp; use Data::Zipper::MOP; my $person = Person->new( name => 'John' ) my $sally = Data::Zipper::MOP->new( focus => $person) ->traverse('name')->set('Sally') ->up ->focus;
Get the value of the current point in the data structure being focused on (as navigated to by traverse)
Traverse deeper into the data structure under focus.
Move "up" a level from the current traversal. Has the effect of unwinding the last traversal.
Replace the value of the current node with a new value.
Replace the value of the current node by executing a code reference.
$_ will be bound to the current value of the node during execution, and the code reference will also be passed this via the first argument.
$_
Repeatedly moves back up the paths traversed, which has the effect of returning back to the same structure as the original input.
Oliver Charles
This software is copyright (c) 2011 by Oliver Charles <oliver.g.charles@googlemail.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Zipper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Zipper
CPAN shell
perl -MCPAN -e shell install Data::Zipper
For more information on module installation, please visit the detailed CPAN module installation guide.