in reply to Re: spaces removed in backreference
in thread spaces removed in backreference

s/(?<=>) +(?=<)//g; s/(>) +(<)/$1$2/g;

Don't know why I never thought of these...

Thanks for the tip on use warnings