#!/usr/local/bin/perl -p # Replaces whitespace (and a single '+' or '!', if present) after 'Subject:' # with two spaces. s/^Subject:\s*[+!]?\s*/Subject: /; # Replaces whitespace-whitespace with ' - '. s/^Subject:\s*-\s*/Subject: - /;