comment line (sed, perl)

sed -i '19375 s/^/#/' file
where 19374 - line number.
perl -pi -e 's/(.*MATCH.*)/#$1/' file
where MATCH - string or part of string, which you would like to comment