sub nodes {  my ($name, $ref, $path) = @_;  if (ref $ref eq "ARRAY") {    nodes($name, $ref->[$_], [@$path, ["array", $_]]) for 0..$#$ref;  }  elsif (ref $ref eq "HASH") {    nodes($name, $ref->{$_}, [@$path, ["hash",$_]]) for sort keys %$ref;  }  else {    print $name;    for my $p (@$path) {      print $p->[0] eq "array" ? "->[$p->[1]]" : "->{$p->[1]}"    }    print qq/ = "$ref";\n/;  } } nodes(q/$a/, $a, []);