Keep It Simple, Stupid | |
PerlMonks |
Re: Re-ordering data branches in a [Tree::DAG_Node] treeby shmem (Chancellor) |
on Apr 23, 2018 at 01:54 UTC ( [id://1213397]=note: print w/replies, xml ) | Need Help?? |
It looks like the container of daughters is an anonymous array, so given your 'original data' and 'desired re-ordered data' it all amounts to re-ordering the daughters array by their name. Maybe you want a method 'walk_down_sorted' or monkey-patch the module in walk_down amounting to:
result with that:
A sort callback for sorting daughters in walk_down would be nice to have. File an enhancement request ;-) edit: this sorting callback should also be available while populating the 'daughters' anonymous array.
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
In Section
Seekers of Perl Wisdom
|
|