There are three related problems:
An explicit declaration of a function and its definition don't match:
>perl -we"sub trim(@); sub trim($) {}" Prototype mismatch: sub main::trim (@) vs ($) at -e line 1.
There's no problem if the declaration has no prototype, so this isn't the cause of your problem.
An implicit declaration of a function and its definition don't match:
>perl -we"trim('abc'); sub trim($) {}" main::trim() called too early to check prototype at -e line 1.
A function's is defined twice with different prototypes:
>perl -we"sub trim {} sub trim($) {}" Prototype mismatch: sub main::trim: none vs ($) at -e line 1. Subroutine trim redefined at -e line 1.
If so, you'll also get a "Subroutine trim redefined" warning. (You do have warnings turned on, right?)
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.
In reply to Re: Prototype mismatch: sub main::trim: none vs ($) at
by ikegami
in thread Prototype mismatch: sub main::trim: none vs ($) at
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |