Hello Dagfinn, Thank you for paying attention to it and improving the possible fix!
20.05.2024 23:39, Dagfinn Ilmari Mannsåker wrote:
Nice cleanup! Did you use some static analysis tool, or did look for them manually?
I reviewed my collection of unica I gathered for several months, but had found some of them too minor/requiring more analysis. Then I added more with perlcritic's policy UnusedVariables, and also checked for unused subs with a script from blogs.perl.org (and it confirmed my only previous find of that kind).
If I add [Variables::ProhibitUnusedVariables] to src/tools/perlcheck/perlcriticrc, it finds a few more, see the attached patch.
Yes, I saw unused $sqlstates, but decided that they are meaningful enough to stay. Though maybe enabling ProhibitUnusedVariables justifies fixing them too.
The scripts parsing errcodes.txt really should be refactored into using a common module, but that's a patch for another day.
Agree, and I would leave 005_negotiate_encryption.pl (with $node_conf, $server_config unused since d39a49c1e) aside for another day too. Best regards, Alexander