in reply to Re: map a hash with a default value or exclude
in thread map a hash with a default value or exclude
or instead of using the ?: in the "decoding" map for the elimination case you could instead use a grep:
%{$self->{info}} = map {@$_} grep {defined $_->[1]} map {chomp; [split +'='];} <$fh>;
In any case generating the array ref doesn't actually seem to be a win in terms of succinctness or comprehensibility.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: map a hash with a default value or exclude
by PrakashK (Pilgrim) on Sep 13, 2011 at 19:09 UTC |