while () { chomp; s/#.*$//; next if /^\s*$/; /([^\s]+)/; push(@enabled_lines, $1); # the if was not necessary :) }