sftriman wrote:
Dr.Ruud:
sub trim { ...
} #trim
You're missing the tr to squash space down
To trim() is to remove from head and tail only.
Just use it as an example to build a "trim_and_normalize()".
So I think it can boil down to:
sub fixsp7 {
s#\A\s+##, s#\s+\z##, tr/ \t\n\r\f/ /s foreach @_;
return;
}
Best remove from the end before removing from the start.
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/