in reply to Re: map and grep syntax question
in thread map and grep syntax question
I think it would be a bit more readable like this:
my $newLoop = [ map {$_ eq $row->{title} ? {'PARTNAME' => $_, 'SELECTED' => 1} : { +'PARTNAME' => $_} } @$parts ] ; #or even my $newLoop = [ map { if($_ eq $row->{title}) { {'PARTNAME' => $_, 'SELECTED' => 1} } else { {'PARTNAME' => $_} } } @$parts ] ;
Jenda
|
We'd like to help you learn to help yourself Look around you, all you see are sympathetic eyes Stroll around the grounds until you feel at home -- P. Simon in Mrs. Robinson |
|
|---|