#!/usr/bin/perl use strict; use warnings; use Data::Dumper qw/Dumper/; use Perl6::Say; use Tree::Simple; my $tree = Tree::Simple->new("0", Tree::Simple->ROOT); my $sub_tree = $tree->addChild(Tree::Simple->new("1")); $sub_tree->addChildren( Tree::Simple->new("2.1"), Tree::Simple->new("2.2") ); say $tree->getChild("2.1")->getNodeValue(); say $tree->getChild("2.2")->getNodeValue();