http://qs1969.pair.com?node_id=432727

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Wise ones,

I'm a newbie to perl and I need some help with regular expressions to do some string manipulation.
The first thing I want to be able to do is add a space where there are capital letters, except right at the beginning of a sentence. At first I thought split would work, but this removes the capital letter. This is basically what I want to achieve:

HelloMyNameIsJake = Hello My Name Is Jake

The second thing I want to do is reduce all whitespace to a single space char. So any number of single spaces, tabs or newlines would become just " ".

I would be grateful if anyone out there can help me with this and perhaps give me a break down of what you have done so I understand it for the future.

Many thanks, Jake