UPDATE:
The docs are bit confusing at first glance, so here is a
quicky example:
And here is catalog.xml:use DBI; use Class::Phrasebook::SQL; use Data::Dumper; my $book = Class::Phrasebook::SQL->new(undef,'catalog.xml'); $book->load('MP3'); my $sth = $dbh->prepare($book->get('GET_SONGS')); $sth->execute('Genesis'); print Dumper $sth->fetchall_arrayref({});
I think you can see how easy it would be to create a lookup hash that points to the catalog entries.<?xml version="1.0"?> <!DOCTYPE phrasebook [ <!ELEMENT phrasebook (dictionary)*> <!ELEMENT dictionary (phrase)*> <!ATTLIST dictionary name CDATA #REQUIRED> <!ELEMENT phrase (#PCDATA)> <!ATTLIST phrase name CDATA #REQUIRED> ]> <phrasebook> <dictionary name="MP3"> <phrase name="GET_SONGS"> select * from songs where artist = ? </phrase> </dictionary> </phrasebook>
2UPDATE:
I really should give credit to eduardo for introducing me to this module. Oh, there is also a perl.com article that you should read as well.
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Navigating the plethora of SQL modules
by jeffa
in thread Navigating the plethora of SQL modules
by dragonchild
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |