in reply to commenting regular expressions (take two)?

The /x modifier does exactly what you want. See the section about modifiers in perldoc perlre.