<?xml version="1.0" encoding="windows-1252"?>
<node id="976161" title="Re^3: Mysql and Perl Module" created="2012-06-14 05:29:47" updated="2012-06-14 05:29:47">
<type id="11">
note</type>
<author id="645661">
tospo</author>
<data>
<field name="doctext">
The ideal situation for that scenario is that your module takes some sort of config file with the DSN for the databse connection so that you can ship it with a tailor-made config file for each of your customers.&lt;br/&gt;
Look at something like &lt;a href="
http://search.cpan.org/dist/Config-General/General.pm"&gt;Config::General&lt;/a&gt; to handle such a config.&lt;br/&gt;
Alternatively, you could make the DSN an argument that needs to be supplied by the user when running this script.&lt;br/&gt;
If you have a lot of stuff to do with that database then it would also be worth exploring something like &lt;a href="http://search.cpan.org/~frew/DBIx-Class/lib/DBIx/Class.pm"&gt;DBIx::Class&lt;/a&gt; to handle your database in a much more abstract way.</field>
<field name="root_node">
976138</field>
<field name="parent_node">
976144</field>
</data>
</node>
