http://qs321.pair.com?node_id=241118


in reply to Re: simple regex problem
in thread simple regex problem

$line =~ s/\s+/ /g;     # replace more than one space with one space

This replaces a sequence of whitespaces with a single space char. This might or might not be what the poster wanted. To just affect spaces and replaces multiple occurrences with one, I'd recommend tr///: $line =~ tr/ / /s;

-- Hofmator