[Solved] Error: Bareword “params” not allowed while “strict subs”

After clicking on a submit button, I am getting an error:

Bareword "params" not allowed while "strict subs" in use at /var/www/path/get.pl line 71

Line 71:

my @names = params;

I do have use strict; nearly at the top.

How to fix?

Note: It work on the old server, I am moving all the files to a new server. Not sure where it went wrong?

Solution #1:

params is most likely a name of a subroutine that was supposed to be imported from another module (based on style, possibly a constant which in Perl is implemented as a subroutine as well).

Search the rest of your code for both sub params and simply my.*params regexes on the old server, and make sure whichever file declares them is present on the new one..

Respondent: DVK

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.