my @sub_locs = grep { $_ } map { /taxman\.add\.subloc\.(.*)/ } @session_keys; #### my @sub_locs = grep { defined $_ } map { /taxman\.add\.subloc\.(.*)/ } @session_keys; #### my @sub_locs = map { /taxman\.add\.subloc\.(.+)/ } @session_keys;