$line =~ s/\s+\z//;