On 9 Nov 2007 at 16:35, Jenda Krynicky wrote: > From: "Beginner" <[EMAIL PROTECTED]> > > #!/bin/perl > > > > use strict; > > use warnings; > > use Data::Dumper; > > > > my @keys = qw(fe fi fo thumb); > > my @valone = 1..4; > > my @valtwo = 10..14; > > my %hash; > > @[EMAIL PROTECTED] = [EMAIL PROTECTED],@valtwo]; > > [...] creates an array reference. You want > > @[EMAIL PROTECTED] = ( [EMAIL PROTECTED],[EMAIL PROTECTED]); > > Probably. Though it will only set the values for 'fe' and 'fi', > because I only specify two values. >
What I was attempting was to have each key to be assigned the coresponding items from the array. So it might look like something like: $VAR1 = { 'fe' => [ 1, 10 ], 'fi' => [ 2, 11, ], 'fo' => [ 3, 13, ], 'thumb' => [ 4, 14, ] }; (yes I typed that by hand) and not $VAR1 = { 'fo' => undef, 'fi' => [ 10, 11, 12, 13, 14 ], 'fe' => [ 1, 2, 3, 4 ], 'thumb' => undef }; But I see why it's hasn't worked. Dp, -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/