in reply to regexp problem

from perlfaq:
for ($string) { s/^\s+//; s/\s+$//; }