Shawn H Corey wrote:

$text =~ tr{\t}{ };
$text =~ tr{\n}{ };
$text =~ tr{\r}{ };
$text =~ tr{\f}{ };
$text =~ tr{ }{ }s;

That can be written as:

  tr/\t\n\r\f/ /, tr/ / /s for $text;

But it doesn't remove all leading nor all trailing spaces.

--
Ruud

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to