At 04:48 PM 3/19/2004 -0500, you wrote:
stuart meacham wrote:
> If I have 2 arrays that I want to assign to the keys and values of a
> hash respectively, what would be easiest way to do that?

@[EMAIL PROTECTED] = @valuesarray

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

I tried: -------------------------------------------------------------------------------------------------- use strict; use warnings; use Data::Dumper;

my @keysarray = qw/a c b d f g t l w x v z/;
my @valuesarray = qw/1 2 3 4 5 6 7 8 9 10 11 12/;

my @[EMAIL PROTECTED] = @valuesarray;

   print Dumper @[EMAIL PROTECTED];
-------------------------------------------------------------------------------------------------
And get syntax error at "@hash{"    ???


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