substr( $line, rindex( $line, '>')) =~ s/\s*;\w*//; # typo corrected, s/:/;/ in the regex