It's inside a bunch of rules for which you give "Normal linguistics/interpunction." as a reason. I don't think that applies for the quoted rule - I'd like to know why you would never write 4 == $foo.
It's kind of normal to put the topic (subject) first. 4 is not the topic, because you already know what 4 is. $foo is what you are unsure about.
Consider these sentences:
"If the image on the cover is a camel, the book is probably Programming Perl."
"If a camel is the image on the cover, the book is probably Programming Perl."
"If foo is 4, ..."
"If 4 is foo, ..."
The camel is constant, the image can be anything.
- firstname.lastname@example.org (do not use).