############################## # This code has been tested. # ############################## # Step 1 - Get your starting list my @main_list= ('Currency','USD','Asset','Equity','Country','USA'); # Step 2 - Generate the sub-list my @sublist_indices = grep { !(($_ + 1) % 2) } (0 .. $#main_list); my @sublist = @main_list[@sublist_indices]; # Step 3 - Do the action(s) on the sub-list my $string = join '_', @sublist; print "'$string'\n";