On Thu, Jan 22, 2009 at 19:12, Rob Dixon <rob.di...@gmx.com> wrote: > 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 >
Whoops, that is what I get for not testing code I post. -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/