Easy.
while(<>) {
$_ =~ s/([^ ])=/$1 =/;
$_ =~ s/=([^ ])/= $1/;
print;
}
The [^ ]=, which means "not space followed by equal sign". But since [^ ] will by itself eats a symbol - you will need to "preserve it"
by using parenthesis, and reuse that symbol by using $1.