Subject: transform array into hash

Hi all,

just easy question, here is too much hours and my brain doesn't work
any more. How to transform array into hash ?

my @array = 1..4;

I want to have:
%hash = ( one => 1, two => 2, three => 3, four => 4 );

tried something like this, but it doesnt work:
my $hash{qw/one two three four/} = (1..4);

Anyone?

Obviously you have more than 4 items(?)... 

What do you have? What do you want/have for keys and what do you want/have
for values?

jwm

-- 
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