in reply to Postorder on hash structure

#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11135697 use warnings; my $structure = { "tool" => "A", "version" => "1.3", "dependencies" => [ { "tool" => "B", "version" => "8.23", "dependencies" => [] }, { "tool" => "C", "version" => "2.1", "dependencies" => [ { "tool" => "D", "version" => "1.1", "dependencies" => [] } ] } ] }; printsubstructure($structure); sub printsubstructure { my $hashref = shift; printsubstructure($_) for @{ $hashref->{dependencies} }; print "$hashref->{tool}/$hashref->{version}\n"; }