I suppose your solution works only for blank " " and not for other whitespace characters like "\n"
So it's not exactly the same like with \s °
DB<11> $a="x \n \n \n " DB<12> $a =~ s/\s+$// DB<13> x $a 0 'x' DB<14>
The OP should be clearer about the semantics he wants.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
see also Re: How to trim a line from leading and trailing blanks without using regex or non-standard modules
In reply to Re^2: How to trim a line from leading and trailing blanks without using regex or non-standard modules
by LanX
in thread How to trim a line from leading and trailing blanks without using regex or non-standard modules
by likbez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |