perl -pi -e 'BEGIN{$x = "*" x 80} s/^-{40}^M*$/$x/' logfile