Carping About DBI - Final Thoughts
(Page 10 of 10 )
Both DBI and Carp are extremely useful modules. DBI is being worked on extensively and is very popular amongst Perl coders. Its popularity ensures that database drivers are written for even the most obscure platforms and then kept up to date. It's not too difficult to write your own database drivers, so if you have some really strange database you have to interface with, you can put in a little more work and still use DBI.
DBI also makes the process of porting code between databases trivial. If your code is general enough and doesn't use any database specific tricks, then all you may have to do is change the DBD string in the connect() function. Light, fast, well-designed and very well-supported, this is a gem of a module.
Carp is also pretty popular. Many developers still prefer to use die() and warn() directly, but once you're hooked onto Carp, it's difficult to let go. It's a very small module, and using it entails a negligible performance and size hit. It's also small enough to read and understand...which means that it can be easily modified or customized.
Both these modules come with good documentation, although the documentation which ships with DBI is far more complete. Be sure to not only read the DBI documentation, but also the documentation for the relevant DBD, since it will usually contain sample code and detailed information about each and every available function.
You can obtain more information on both these modules at any of the links below:
The DBI FAQs at
http://theoryx5.uwinnipeg.ca/cgi-bin/doc-filter?page=data/DBI/DBI/FAQ.html;q uery=dbi;match=and;where=all;stem=;type=data and http://theoryx5.uwinnipeg.ca/cgi-bin/doc-filter?page=data/DBI/DBI.html;query =dbi;match=and;where=all;stem=;type=data"A Short Guide To DBI" by Mark-Jason Dominus at
http://www.perl.com/pub/1999/10/DBI.htmlCheck 'em out, and I'll see you soon!
This article copyright Melonfire 2001. All rights reserved.| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |