# Strip leading and trailing whitespace from a string $str = unpack "A*", (split ' ', $str, 1)[0]; [download]
Speaking of perlfaq4 and stripping whitespace, check out trim() by japhy; a really neat sub that wraps and builds upon the FAQ-recommended solution.
--k.