Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

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

by mandog (Curate)
on Oct 03, 2009 at 17:48 UTC ( #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.


Comment on Re^2: put SQL::Library file where?
Select or Download Code
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()};

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://799034]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2014-12-28 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (179 votes), past polls