
|
|
|||
Cultured Perl: Embedding Perl in database tablesBy Teodor Zlatanov2005-04-27
Put Perl into your RDBMS Design to Reach Database Nirvana In this installment, Ted looks at Perl and databases. Specifically, he works with the Class::DBI CPAN module and MySQL to introduce you to embedding Perl in database tables. Databases and the applications that use them are essential to today's computing infrastructures. They are everywhere, from plain-text databases such as the UNIX® /etc/passwd file to large databases such as those that track shopping habits or fight credit card fraud. This article looks at a specific aspect of the integration of Perl tools with generic RDBMSs (relational database management systems): embedding Perl in the database tables. I can already feel the tug of the database design purists at my sleeve -- this is neither a standard nor a portable approach. I know this, but there are two things about Perl that purists should know: • "TMTOWTDI" is the Perl mantra. It means "There's More Than One Way To Do It." • The quintessential quality of a Perl programmer is productive laziness (or lazy productivity). Embedding is a productively lazy thing to do, but if you do not understand the consequences of moving to Java®, for example, you should avoid embedding Perl code in databases. In this article we'll use the Class::DBI CPAN module to manage database tables (more on that in the next section). While this article is suitable for beginner programmers as well the experienced, you will need some knowledge of database programming, especially with the Class::DBI CPAN module using MySQL (my environment). At a minimum, you should understand how to set up and use MySQL and how to create tables in a MySQL database. (And if you don't, see the Resources section for a quick-start tutorial on MySQL.) Tutorial Pages: » Put Perl into your RDBMS Design to Reach Database Nirvana » Class::DBI Capabilities » Setting up Tables » Embedded Deletion » Embedded Modifications » Compatibility with Other Languages and Alternative Approaches » Conclusion » Resources First published by IBM DeveloperWorks
|
||||
| About the NetVisits, Inc Network | Write For Us | Advertise Copyright ©2007 NetVisits, Inc Network. All Rights Reserved. Privacy Policy. |
Visit other NetVisits, Inc. sites: |