NAME

Data::Shared::Node - A cursor into a Data::Shared namespace

SYNOPSIS

my $alice = $root->node('/users/alice');
$alice->call('count');
$alice->get('/event-42');
my @kids = $root->node('/users')->children;

DESCRIPTION

Returned by $root->node($path) and by shared_get on an intermediate composite path. Holds a root plus absolute path components. A path-taking method appends its relative argument -- a string, an arrayref or a compiled path, omitted for the node itself -- to those components and dispatches it through Data::Shared; call takes a method name instead, and call_at a relative path and then a method name.

root, components, path

Accessors. path is the display form (ambiguous for components containing /; use components programmatically). components returns a copy.

get, set, delete, exists, incr, push, pop

Relative-path forms of the generic verbs: the relative path is always the first argument, so addressing the node itself means passing '' ($node->push('', $value), $node->set('', $value)).

call($method, @args), call_at($rel, $method, @args)

call invokes a native method at the node itself; call_at at a relative path below it.

node($rel), children, handle

node returns a deeper cursor, children lists child addresses at a composite node, and handle returns the native handle when the node is exactly a leaf (or a composite child leaf).