trim is often used by beginners, who may not understand how to spin their own. While String::Util does have a trim function, it depends on Debug::ShowStuff, which depends on Taint, which fails the test suite, and doesn't appear to be maintained. This module installs, is actively maintained, and has no non-core dependencies.

Other options include Text::Trim and String::Strip (which is implemented in XS, and is therefore likely to be very fast, but requires a C compiler).