geektron has asked for the wisdom of the Perl Monks concerning the following question:
i'm trying to get an arrayref from this:
but Data::Dumper is showing me that $newLoop is empty ...my $parts = [ 'Part1', 'Part2','Part3' ]; my $newLoop = [ grep { $_->{SELECTED}++ if $_->{PARTNAME} eq $row->{title}, $_ } map +{ 'PARTNAME' => $_ }, @$parts ] ;
what i expect:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: map and grep syntax question
by Joost (Canon) on Dec 10, 2004 at 21:39 UTC | |
by geektron (Curate) on Dec 10, 2004 at 22:47 UTC | |
by Jenda (Abbot) on Dec 11, 2004 at 22:27 UTC | |
|
Re: map and grep syntax question
by revdiablo (Prior) on Dec 10, 2004 at 22:00 UTC | |
by Joost (Canon) on Dec 10, 2004 at 22:06 UTC | |
by geektron (Curate) on Dec 10, 2004 at 22:46 UTC | |
by revdiablo (Prior) on Dec 10, 2004 at 23:17 UTC | |
|
Re: map and grep syntax question
by gaal (Parson) on Dec 10, 2004 at 21:38 UTC |