How does this work, given that you are never changing @key and you never set $k? And doesn't $root = $root->{ $k }; just dereference rather than move the root?
Update: to answer my own questions - the previously missing line allows for the changes and the root moves because of the explicit creation of the sub-hashref. Good solution (++).
In reply to Re^2: condense conditional
by hippo
in thread condense conditional
by mdidomenico
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |