my @destructible = @$ref; while ( @destructible ) { my( $key, @val ) = splice @destructible, 0, 3; $out{ $key } = \@val; }