I am using RHEL 8 server where perl v5.26.0 has been installed. In my project there are lots of legacy perl modules who are using Mysql.pm as below.
require 5.004;
require Exporter;
use Mysql;
While compiling those modules, I am getting errors like,
Can't locate Mysql.pm in @INC (you may need to install the Mysql module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5)
I have already installed, DBD::mysql and mysql-devel.
yum install mysql-devel
DBD::mysql through cpan.
If I change the import from Mysql to DBI, the compiler does not complain. So now changing all legacy modules is time taking and risky from testing point of view.
Is there any way to downgrade the perl version to v5.16 or below? Other suggestions are much appreciated.
Mysqlis a very old interface to MySQL databases from back in the days beforeDBI. It has no connection at all toDBI::mysql. The last version on CPAN is over twenty years ago.You could try to install that CPAN distribution on your server (but, to be honest, the CPAN Testers results don't look encouraging).
Your best bet (and, yes, it will probably be a bit of work) is to rewrite your code to use DBI::mysql instead. Maybe you can write your own shim in a module called
Mysqlthat converts the oldMysql-style calls toDBI::mysqlones.