Two quick notes:
Your inner while is redundant with your outer while. You can get rid of
push @ret, [ shift ] while @_ and (! $_[1] or ! ref $_[1]);
It wouldn't have hurt to note that your function destroys the original data structure.
Update: Me bad.
In reply to Re^2: A maybe(?) interesting comp-sci type problem
by ikegami
in thread A maybe(?) interesting comp-sci type problem
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |