Why not use one of the available object oriented persistence modules available on CPAN. Look at this example from
Class::DBI:
package Music::DBI;
use base 'Class::DBI';
Music::DBI->set_db('Main', 'dbi:mysql', 'username', 'password');
package Artist;
use base 'Music::DBI';
Artist->table('artist');
Artist->columns(All => qw/artistid name/);
Artist->has_many('cds', 'CD' => artist);
# ...
my $artist = Artist->retrieve($id);
(This module can actually do a lot more interesting things than that)
A good place to look for more info on object oriented persistence is the POOP comparison website.
--
#!/usr/bin/perl -w
use strict;$;=
";Jtunsitr pa;ngo;t1h\$e;r. )p.e(r;ls ;h;a;c.k^e;rs
";$_=$;;do{$..=chop}while(chop);$_=$;;eval$.;