sftriman wrote:
Dr.Ruud:
sub trim { ... } #trimYou'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: [email protected] For additional commands, e-mail: [email protected] http://learn.perl.org/
