It might just be a typo, but as written that code will only trim trailing whitespace if there is no leading whitespace... In other words, if a string has leading whitespace it won't ever check for trailing whitespace. You'll need the /g modifier to get your example code to match your spec.$data =~ s/^\s+|\s+$/;
$data =~ s/^\s+|\s+$/g;
-Blake
In reply to Re: Can I change the definition of '\s'?
by blakem
in thread Can I change the definition of '\s'?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |