$aref = ['one', 'two', 'three', 'four'];; $href = { pop @$aref => 1 };; $href = { pop @$aref => $href } while @$aref;; pp $href;; { one => { two => { three => { four => 1 } } } }
In reply to Re: Change array to tiered hashref - brain teaser
by BrowserUk
in thread Change array to tiered hashref - brain teaser
by jonathan415
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |