You can use splice to extract regions out if the original array (i.e. if you don't want to copy to a new one)
Otherwise just slice and copy.
$new[$i++] = [ @old[$start..$end ] ]
And for traversing use a recursive function which calls itself when an array-ref is read.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
In reply to Re: How might I handle a special tree?
by LanX
in thread How might I handle a special tree?
by vitoco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |