On Nov 9, 11:09 am, [EMAIL PROTECTED] (Beginner) wrote:
> What I was attempting was to have each key to be assigned the
> coresponding items from the array.

Why didn't you just say that in the first place, rather than letting
everyone guess as to what you wanted?

> So it might look like something
> like:
>
> $VAR1 = {
>         'fe' => [
>                         1,
>                         10
>                    ],
>         'fi' => [
>                         2,
>                         11,
>                    ],
>         'fo' => [
>                         3,
>                         13,
>                    ],
>         'thumb' => [
>                                 4,
>                                 14,
>                                 ]
>
> };
>

#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
use List::MoreUtils 'each_array';
my @keys = qw/fe fi fo fum/;
my @one = (1..4);
my @two = (11..14);
my $it = each_array @one, @two;
my %h;
@[EMAIL PROTECTED] = map { [ $it->() ] } [EMAIL PROTECTED];
print Dumper(\%h);
__END__

Paul Lalli


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


Reply via email to