Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: put SQL::Library file where?

by mandog (Curate)
on Oct 03, 2009 at 17:48 UTC ( [id://799034] : note . print w/replies, xml ) Need Help??

in reply to Re: put SQL::Library file where?
in thread put SQL::Library file where?

The issue is that when installed our .pm files will end up in any one of:

./ /usr/local/lib/site_perl /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl

We can say:  use OurApp::LibName; and find our libs

We can't say  my $sql_lib=new SQL::Library {lib=>'sql.lib'}; We have to say: my $sql_lib=new SQL::Library {lib=>'/full/path/to/sql.lib'}

We could write code to search @INC for our file, but that doesn't seem right

There is little or no code in our libraries that is useful outside our application, so publishing to cpan might no make sense. Following the conventions of a cpan package may make our life easier even if we don't ever make a package.

Replies are listed 'Best First'.
Re^3: put SQL::Library file where?
by SilasTheMonk (Chaplain) on Oct 03, 2009 at 18:52 UTC
    So as I understand it the question is how to rationalize the configuration of your app. Where would you like your config file to be? I think you need to first of all figure that out. Then you need to figure out how to inform your app of that location. You may want to think about what your ideal format would be. There are probably several modules in CPAN to read those config files. One of your lines would be the location of your SQL::Library file. So you code might end up as
    my $config = [....code to read config file]; ..... my $sql_lib=new SQL::Library {lib=>$config->sqllib_path()};