I don't find the latter ugly at all, and have no problem with the former either (in fact, I prefer it, as quicker to read shorthand for the latter).That is just ugly for a variety of reasons, ... In fact, the map statement could probably be written more clearly as follows:@servers = map { $_->{selected} ? $_->{obj} : () } @servers;That’s easier to read, but it’s still pretty ugly.@servers = map { $_->{obj} } grep { $_->{selected} } @servers;
In reply to Re: Maintaining State with Runtime Traits
by ysth
in thread Maintaining State with Runtime Traits
by Ovid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |