Could Common::String::trim work here even though it also strips leading spaces?