Skip to content

Restore compatibility with older Perl versions#882

Open
jasongill wants to merge 1 commit intomajor:masterfrom
jasongill:master
Open

Restore compatibility with older Perl versions#882
jasongill wants to merge 1 commit intomajor:masterfrom
jasongill:master

Conversation

@jasongill
Copy link

@jasongill jasongill commented Feb 23, 2026

The README.md indicates that the project supports Perl 5.6+, but the r modifier is used on two regular expressions; this modifier was not added until Perl 5.14, so the script fails on older versions of Perl.

Testing on Perl 5.10, for example:

Bareword found where operator expected at mysqltuner.pl.1 line 5409, near "s/\|/\`/gr"
syntax error at mysqltuner.pl.1 line 5409, near "s/\|/\`/gr"

The r modifier for the regex is simply a shortcut that allows for a one-liner in the code, but it is not necessary for the script to function (and in fact, is only used in 2 places in the script).

This pull request removes the r modifier and restores the replacement logic to 2 lines as opposed to the one-liner syntax that is only supported on Perl 5.14+.

By merging this patch, the latest version of MySQLTuner will function on older versions of Perl again. This bug was introduced in commits 9db65eb and 79522b2

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

Successfully merging this pull request may close these issues.

1 participant