my @all = ; my @some = grep { !/^\s*$/ } (my @most = map { s/#.*$//; $_ } @all); #### s/#.*$// for my @most = @all;