$data = { foo => 3, bar => [ qw/ this that 3 / ], 3 => undef, baz => { trois => 3, quatre => [ qw/ 1 2 3 4 / ], } }; ok $paths = path( $data, 3 ), 'Fetching paths for matching data should succeed'; my @expected = sort ( '{bar}[2]', '{baz}{trois}', '{baz}{quatre}[2]', '{foo}' ); $paths = [ sort @$paths ]; is_deeply $paths, \@expected, '... and we should be able to match complex data structures'; foreach my $path (@$paths) { is eval "\$data->$path", 3, '... and each element should have the correct value'; }