On 10/27/2012 07:42 PM, Rob Janes wrote: > Slurp the file and run the second regex. > > undef $/; > $exp = <in>; use File::Slurp is much better for that. > $exp =~ s/(\s)\1+/\1/g; i keep saying to not use \1 in the replacement. it is documented to be wrong but supported. don't use it there. use $1 uri