And, if you're using MySQL then the example can be even smaller:
package Song;

use base qw(Class::DBI::mysql);

__PACKAGE__->set_db( 'Main', 'dbi:mysql', 'username', 'password' );


package main;
No need to declare your columns, as it will go ask the database for them. I keep meaning to find out how to do this for other databases, and roll them in ...


In reply to Re: Class::DBI example by salvadors
in thread Save MP3 Tag's to Database with SPOPS by jeffa

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":