Chas. Owens wrote:
>
> What is so hard about
> 
> $string =~ s/^[ ]*(.*)[ ]*$/$1/;

It's not hard, it just won't strip trailing spaces because your captured string
has a greedy quantifier!

I usually use

  s/^\s+//, s/\s+$// for $string;

Rob

-- 
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