Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How do I extract a list of DB values (Alpha, Beta, Gamma)? Can I do this with a slice?my $aref = [{DB => 'Alpha', SOURCE => 'here'}, {DB => 'Beta', SOURCE => 'there'}, {DB => 'Gamma', SOURCE => 'someplace'}];
only yields "Gamma". Thanks in advance.my @list = @$aref[0..2]->{DB};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Slice of an array of hashes
by dragonchild (Archbishop) on Oct 24, 2005 at 19:11 UTC | |
|
Re: Slice of an array of hashes
by Roy Johnson (Monsignor) on Oct 24, 2005 at 19:16 UTC | |
by VSarkiss (Monsignor) on Oct 24, 2005 at 19:29 UTC | |
|
Re: Slice of an array of hashes
by ioannis (Abbot) on Oct 24, 2005 at 20:55 UTC | |
|
Re: Slice of an array of hashes
by murugu (Curate) on Oct 25, 2005 at 08:48 UTC |