while ( <$fh> ) { chomp; # Remove trailing newlines (a subset of \s) s/\s//g; # Remove ALL whitespace. next if /^#/; # Skip comments. next if /^\s*$/; # Skip lines with space, or lines with nothing. # This doesn't make sense because you # already removed all space. But it # works because you allow it to match # 'nothing' too. next if $_ eq "";# This line is never true, because # you already skipped lines with nothing # in the previous statement. #......