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
In Section
Seekers of Perl Wisdom