Thanks for replying! 
 
Actually, I have a highly complex datastructure in which both strings,
lists and hashes are values in a primary hash. 
 
e.g. 
 
$hash{$key}[0] = @list; 
$hash{$key}[1] = $string; 
$hash{$key}[2] = %hash; 
 
I need to assign these values to a specific (number)entry in the primary
hash, so I know which entry has which value. 
 
Anders. 
 


>>>Shawn Corey <[EMAIL PROTECTED]> 01/15/06 7:16 pm >>>
Anders Stegmann wrote:
>Hi!
> 
>how do I assign a list to a hash entry like $hash{$key}[0].
> 
>I mean, something like this:
> 
>$hash{$key}[0] = @list;
> 
>must work.
> 
>Anders.
>
>

Close. Try:

use Data::Dumper;
$hash{$key} = [ @list ];
print Dumper( \%hash );


--

Just my 0.00000002 million dollars worth,
   --- Shawn

Probability is now one. Any problems that are left are your own.
   SS Heart of Gold, _The Hitchhiker's Guide to the

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is available at http://perldoc.perl.org/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to