quikk has asked for the wisdom of the Perl Monks concerning the following question:
I'm brand new to perl, and I'd like to request some help on a topic that has puzzled me:
According to CPAN, "1.19_10 M(y)sqlPerl is no longer a separate module. Instead it is emulated using the DBI drivers."
If I've got tons of code that uses use Mysql;, and a little code that uses a custom sql wrapper for DBI, use CUSTOM::SQL;. I need to convert all instances of "Mysql" database connectivity to the custom wrapper, but I believe "use Mysql;" uses different functions than "use DBI;", such as:
@arr = $sth->fetchrow; vs. @row_ary = $sth->fetchrow_array;,
$dbh = Mysql->connect($host, $database, $user, $password); vs. CUSTOM::SQL::connect();, and so on.
My question: Should I just do "find/replace" on all of the Mysql-particular functions for the DBI-particular functions? Or is there some set of functions applicable to both modules?
If anyone could point me to a reference that might help with Mysql module to DBI module conversion, I'd be ecstatic, as I've searched high and low.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use Mysql; vs. use DBI;
by thomas895 (Deacon) on May 19, 2012 at 19:55 UTC | |
by tobyink (Canon) on May 20, 2012 at 10:47 UTC | |
by Mr. Muskrat (Canon) on May 21, 2012 at 18:39 UTC | |
by thomas895 (Deacon) on May 22, 2012 at 00:08 UTC |