in reply to Re: Re: Using map
in thread Using map
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 { $_ } map { /taxman\.add\.subloc\.(.*)/ } @sessio +n_keys;
perhaps?my @sub_locs = grep { defined $_ } map { /taxman\.add\.subloc\.(.*)/ } + @session_keys;
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!
is enough!my @sub_locs = map { /taxman\.add\.subloc\.(.+)/ } @session_keys;
-- Randal L. Schwartz, Perl hacker
|
|---|