The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Zipper::API

SYNOPSIS

    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;

ATTRIBUTES

focus

Get the value of the current point in the data structure being focused on (as navigated to by traverse)

METHODS

traverse

Traverse deeper into the data structure under focus.

up

Move "up" a level from the current traversal. Has the effect of unwinding the last traversal.

set

Replace the value of the current node with a new value.

set_via

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.

zip

Repeatedly moves back up the paths traversed, which has the effect of returning back to the same structure as the original input.

AUTHOR

Oliver Charles

COPYRIGHT AND LICENSE

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.