$out{shift @ref} = [splice @ref,0,2] while @ref; #### 2 => [ 0, 1 ], 5 => [ 3, 4 ] etc. #### die if @ref % 3; $out{$a} = [splice @ref,0,2] while $a = shift @ref;
## 2 => [ 0, 1 ], 5 => [ 3, 4 ] etc. ##
## die if @ref % 3; $out{$a} = [splice @ref,0,2] while $a = shift @ref;