in reply to matching in a line

How about $word =~ s/\:.*$//;