# Strip leading and trailing whitespace from a string $str = unpack "A*", (split ' ', $str, 1)[0];