Re: [CDBI] CDBI Newbie Question
[prev]
[thread]
[next]
[Date index for 2005/09/28]
> > 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} );
> >
> 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
>
Thats what I was thinking when I read the post. You have your file:
ANPerl/AnalysisFramework/ResourceStore/Metadata/DBDiscoverySetResources.pm
and in that file declare the package like so:
package DBDiscoverySetResources;
> > Then [YOU] could just write
> > $current_dsr_row = DBDiscoverySetResources->create( {RetrievalUrl =>
> > $retrieval_url} );
Whatever loaded the module before will load it the exact same way and you'll
have your CDBI stuff in a programmer friendly namespace.
Todd W.
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi