in reply to Using map
If I follow your quest, you are looking to take @session_keys and grab any entry that contains the taxman string, but only the part after the taxman string. I think this is closer:
If the regex matches, then $1 is added to the output list. If the regex doesn't match, then an empty list is added, which means the item is essentially ignored.my @sub_locs = map { /taxman.add.subloc.(.*)/ ? $1 : () } @session_keys;
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using map
by Masem (Monsignor) on Oct 05, 2001 at 00:42 UTC | |
by merlyn (Sage) on Oct 05, 2001 at 00:56 UTC |