neniro has asked for the wisdom of the Perl Monks concerning the following question:
I've already got a solution for this problem, but I'm still thinking about different way to do it (using map)?
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $box = [ { id => 'q01' }, { id => 'q02' }, { id => 'q03' }, ]; my @results = qw ( foo bar buz ); my $i = 0; for (@$box) { $_->{value} = $results[$i++]; } print Dumper($box);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Merging an array into an AoH
by BrowserUk (Patriarch) on May 21, 2004 at 20:09 UTC | |
by rjray (Chaplain) on May 22, 2004 at 00:36 UTC | |
Re: Merging an array into an AoH
by diotalevi (Canon) on May 21, 2004 at 19:54 UTC | |
Re: Merging an array into an AoH
by geekgrrl (Pilgrim) on May 21, 2004 at 20:39 UTC | |
by neniro (Priest) on May 21, 2004 at 20:53 UTC |
Back to
Seekers of Perl Wisdom