http://www.perlmonks.org?node_id=319192


in reply to one hash value (array) into another

Really close.

What your hash ends up looking like is:

%hash = ( 'one' => [ 'abc', 'def', 'ghi' ], 'two' => 3 );

This is because $hash{'two'} is being assigned the length of the array held in $hash{'one'}. (in the same way that $array_size = @array would assign $array_size the length of @array)

What I assuming you want is a hash that ends up like:

%hash = ( 'one' => [ 'abc', 'def', 'ghi' ], 'two' => [ 'abc', 'def', 'ghi' ] );
which can be accomplished by something like so:
$hash{'two'} = [ @{$hash{'one'}} ];

-enlil