[CDBI] CDBI Newbie Question

Jay Strauss me at heyjay.com
Wed Sep 28 03:02:49 BST 2005

Maybe I'm misunderstanding, but have you looked at

use lib qw/.../

or export a PERL5LIB environmental var?

Just because you stick a .pm somewhere down in a directory structure 
doesn't mean you have to have the package name refer to each directory 
above, especially if those parent dirs have nothing to do with perl

my 2 cents


Steven Mackenzie wrote:
> Hello,
> I'm new to Perl (and to CDBI!), I hope someone can spare a minute to
> help me with a tangentially relevant question ... or point me in the
> right direction to ask or read more!
> I have written some test code to talk to a SQLite DB file and read data
> in to it via classes derived from Class::DBI. My test script worked
> fine, so I've factored out my DB access code, and packaged the classes
> for each table in to perl modules (.pm files).
> Is that the normal thing to do?
> Because I'm starting a Big Project, I'm trying to keep my modules tidy,
> and have defined a hierarchy, with all my modules below ANPerl/; for
> example, one of my DB table classes is
> ANPerl::AnalysisFramework::ResourceStore::Metadata::DBDiscoverySetResources
> Unfortunately now in my client code I have lines like
>  $current_dsr_row =
> ANPerl::AnalysisFramework::ResourceStore::Metadata::DBDiscoverySetResources->create(
>       {RetrievalUrl => $retrieval_url} );
> That's a lot of typing! Is there any way to say that I'm using all the
> modules in the path ANPerl::AnalysisFramework::ResourceStore::Metadata?
> Then I could just write
>   $current_dsr_row = DBDiscoverySetResources->create( {RetrievalUrl =>
> $retrieval_url} );
> Thanks in advance for any clues,
> Steven
> _______________________________________________
> ClassDBI mailing list
> ClassDBI at lists.digitalcraftsmen.net
> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

More information about the ClassDBI mailing list