modulereview
wardk
<p><b>Module(s):</b>
<ul><li>Oraperl.pm
<li>DBI.pm (DBD::Oracle)
</ul>
</p>
<p><b>Author(s):</b>
<ul>
<li>DBI and Oraperl emulation using DBD::Oracle by <cite><Tim.Bunce@ig.co.uk></cite>
<li>Original Oraperl 2.4 code and documentation by <cite>Kevin Stock <kstock@auspex.fr></cite>.
</ul>
</p>
<p>This is a short review of the two most used Perl toolkits for retrieving
data from an Oracle database, DBI and Oraperl.</p>
<p>In the beginning, there was Oraperl, and if you were using Perl 4, Oraperl was
the only game in town. Then came Perl 5, then DBI. Now every RDBMS
worth using has a uniform interface for Perl. </p>
<p>But...what to do with all that old Oraperl code? Re-write?, /dev/null?, keep it?
<br>......you *can* keep it!</p>
<p>The Oraperl module (originally written by Kevin Stock) was re-written for Perl 5
by Tim Bunce to use the DBD::Oracle interface. So you get the best of both
worlds...backward compatability for your existing
scripts, and a new API to utilize in case you desire a generic interface that
could perhaps work against another DBI supported RDBMS.</p>
<p>On the job, I use both. I support a web-based HR system that was written
originally in Perl 4 using Oraperl. This codebase now is on Perl 5, however the
scripts still utilize Oraperl.
So for new development I use DBD::Oracle via DBI, and when maintaining existing
scripts I keep using Oraperl.</p>
<p>When first taking over this position, I was convinced that I would need to eventually remove all
that damn Oraperl....then I read the perldoc, and realized that this was not the same
Oraperl I used about 4 years previous in another life, but one written and supported by the
very man who wrote and supported DBI and DBD::Oracle...Tim Bunce. </p>
<p>So instead of spending time re-writing boatloads of working code, I spent some time
using [Benchmark] and attempted to see if there was any significant performance differences
in using DBD:Oracle directly, or using the Oraperl interface to it.
My benchmarks all proved out to me that Oraperl was in fact slower....just barely.
In fact, they were so close in my tests that I just have no valid performance
reasons to rework any Oraperl into native DBI.</p>
<p>So which to use for accessing your Oracle database? Since Tim mentions in the
docs that Oraperl is for backward compatibility, I suggest that you do not <cite>use
Oraperl;</cite> if you are starting fresh. If you have existing code and are
curious to the benefits of porting the code to native DBI...that's your call, I
found no performance reasons for doing so, and since the same man that supports
DBI wrote Oraperl, there shouldn't be any pressing issues over support.</p>
<p>Bottom line is that both these modules are of high quality and production-ready,
you can be safe utilizing either.</p>
<p>For this review, I have decided to not supply any code samples as Tim Bunce has
provided plenty of them in the perldocs.
So if you are curious about syntactical and/or other differences....please refer to these links:</p>
<p>
<ul>
<li><a href="http://search.cpan.org/doc/TIMB/DBD-Oracle-1.06/Oracle.pm">DBD::Oracle at CPAN</a>
<li><a href="http://search.cpan.org/doc/TIMB/DBD-Oracle-1.06/Oraperl.pm">Oraperl at CPAN</a>
</ul>
</p>
Options for accessing Oracle from Perl