use XML::XSH2; @list = qw(this/is/a/twig this/is/a/branch this/is/another/branch); xsh 'create this'; xsh "set $_" for @list; xsh 'ls .';