in reply to Re: Re: Using map
in thread Using map

my @sub_locs = grep { $_ } map { /taxman\.add\.subloc\.(.*)/ } @sessio +n_keys;
Maybe a "bit more intuitive", but "wrong" if the value after taxman string might be empty or the value "0". Did you mean instead:
my @sub_locs = grep { defined $_ } map { /taxman\.add\.subloc\.(.*)/ } + @session_keys;
perhaps?

And of course, as I'm seeing this, the grep isn't even necessary, since on a failed match, the match returns an empty list!

my @sub_locs = map { /taxman\.add\.subloc\.(.+)/ } @session_keys;
is enough!

-- Randal L. Schwartz, Perl hacker