Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error executing script #169

Closed
totojack opened this issue Mar 24, 2016 · 3 comments
Closed

Compilation error executing script #169

totojack opened this issue Mar 24, 2016 · 3 comments

Comments

@totojack
Copy link

I'm trying to execute the script in a centos 7 with perl 5.16.3 but it fails with code error:

perl mysqltuner.pl
String found where operator expected at mysqltuner.pl line 964, near ") "
opened > "" (#1)
(S syntax) The Perl lexer knows whether to expect a term or an operator.
If it sees what it knows to be a term when it was expecting to see an
operator, it gives you this warning. Usually it indicates that an
operator or delimiter was omitted, such as a semicolon.

(Missing operator before " opened > "?)

"my" variable $mysqlverminor masks earlier declaration in same scope at
mysqltuner.pl line 1161 (#2)
(W misc) A "my", "our" or "state" variable has been redeclared in the
current scope or statement, effectively eliminating all access to the
previous instance. This is almost always a typographical error. Note
that the earlier variable will still exist until the end of the scope
or until all closure referents to it are destroyed.

"my" variable $mysqlvermicro masks earlier declaration in same scope at
mysqltuner.pl line 1162 (#2)

syntax error at mysqltuner.pl line 964, near ") " opened > ""
syntax error at mysqltuner.pl line 979, near "}"
syntax error at mysqltuner.pl line 1097, near "}"
syntax error at mysqltuner.pl line 1153, near "}"
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1182.
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1183.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1184.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1185.
Global symbol "$mysqlvermicro" requires explicit package name at mysqltuner.pl line 1185.
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1193.
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1194.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1195.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1196.
Global symbol "$mysqlvermicro" requires explicit package name at mysqltuner.pl line 1196.
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1202.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1203.
Global symbol "$mysqlvermicro" requires explicit package name at mysqltuner.pl line 1204.
BEGIN not safe after errors--compilation aborted at mysqltuner.pl line 3195 (#3)
(F) Probably means you had a syntax error. Common reasons include:

    A keyword is misspelled.
    A semicolon is missing.
    A comma is missing.
    An opening or closing parenthesis is missing.
    An opening or closing brace is missing.
    A closing quote is missing.

Often there will be another error message associated with the syntax
error giving more information.  (Sometimes it helps to turn on -w.)
The error message itself often tells you where it was in the line when
it decided to give up.  Sometimes the actual error is several tokens
before this, because Perl is good at understanding random input.
Occasionally the line number may be misleading, and once in a blue moon
the only way to figure out what's triggering the error is to call
perl -c repeatedly, chopping away half the program each time to see
if the error went away.  Sort of the cybernetic version of 20 questions.

Uncaught exception from user code:
syntax error at mysqltuner.pl line 964, near ") " opened > ""
syntax error at mysqltuner.pl line 979, near "}"
syntax error at mysqltuner.pl line 1097, near "}"
syntax error at mysqltuner.pl line 1153, near "}"
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1182.
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1183.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1184.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1185.
Global symbol "$mysqlvermicro" requires explicit package name at mysqltuner.pl line 1185.
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1193.
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1194.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1195.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1196.
Global symbol "$mysqlvermicro" requires explicit package name at mysqltuner.pl line 1196.
Global symbol "$mysqlvermajor" requires explicit package name at mysqltuner.pl line 1202.
Global symbol "$mysqlverminor" requires explicit package name at mysqltuner.pl line 1203.
Global symbol "$mysqlvermicro" requires explicit package name at mysqltuner.pl line 1204.
BEGIN not safe after errors--compilation aborted at mysqltuner.pl line 3195.

@cowthinker
Copy link

Had the same problem, fixed it by adding a dot at line 964 right after "scalar(@opened_ports)" as follow:

badprint "There is too many listening ports: ". scalar(@opened_ports). " opened > ".$opt{'maxportallowed'}. "allowed.";

@yabi55
Copy link

yabi55 commented Mar 24, 2016

a dot is missing in line 964
Before: scalar(@opened_ports) " opened >
After: scalar(@opened_ports). " opened >

@totojack
Copy link
Author

Thank you guys, the fix solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants