in reply to Prototype mismatch: sub main::trim: none vs ($) at

There are three related problems:

The last problem is the only one I can get to result in "none vs ($)". The solution, of course, is to get rid of the trim you don't want. Note that you might be importing one (or both) from a module.