MBrandonLeavenworth has asked for the wisdom of the Perl Monks concerning the following question:

Dear most esteemed Monks:


It seems that having started to learn computers at 40, I have achieved much, but am still 10 years behind...even with having travelled beyond learning the shell, beyond the stones of configuring apache and the routers and authentication, through the pits of installing psql, into the waters of perl and over the peaks of running CGI scripts.


Now it seems that I am at a 'finish line', to use western-speak, and simply need to connect the Apache user account to psql through the DBD::Pg module. It has occurred to me in this final project that there is a natural balance between the desire of men to do good and the good that men receive from the efforts. And whether it is due to my own impatience, or innate uncontrolled anger, or perhaps frustrated paranoia, or maybe lack of cunning or intelligence, or perhaps simply being a young soul, that I wonder, is it really worth installing DBD::Pg in the first place? Of course, that portends the future which is something no man can know.


So perhaps it would be better to pursue a more narrow path and ask, which file or files, precisely, must be discoverable by @INC when trying to use DBD:Pg and having installed the latest O-Reilly DBI and version DBD-Pg-3.3.0 on MacOSX? It may bode ill for me that these modules may have already been on my system, had I not removed them. But again, perhaps they are still there. That which seems gone is often not always gone.

Replies are listed 'Best First'.
Re: DBD challenge
by wjw (Priest) on Jun 13, 2014 at 03:25 UTC

    Welcome to the Monastery. Nice writing style...though it leaves me to wonder about a thing or two:

    Were they on your system?

    Did you remove them, and if so, how.

    ..and how did you ..er.. re-install them? CPAN? cpanm? With a proper install, I shouldn't think you would have a question, you would be up and running. I run Linux as compared to MacOSX, but can't imagine that the install is that much different, and properly done, you shouldn't have an issue. So what happened?

    Were there errors during install? If so, show them please. If not, what are you seeing now? What is not working?

    Update: Reading through Anonymous Monks fist link seems right on to me... re-posted link in this node for my own reference. Thanks to whoever Anonymous Monk was this time.

    ...the majority is always wrong, and always the last to know about it...

    Insanity: Doing the same thing over and over again and expecting different results...

    A solution is nothing more than a clearly stated problem...otherwise, the problem is not a problem, it is a facct

      Thank you for your guidance. I do not know if they were on my system. I may never know. I cannot know for certain, which means that I am uncertain of something which does not exist.

      Whatever would be properly done should be done without error. I, however, have done less than that. Or perhaps more than that. The excess and the deficient. That which is and that which is not.

      But certainly, I have erred in the way of excess, for as you can see, I have attempted to install the module multiple times without knowing what I was doing:

      /Users/UserName1/.cpan/build/DBD-Pg-3.3.0-_Lh4Ff/blib/arch/auto/DBD/Pg

      /Users/UserName1/.cpan/build/DBD-Pg-3.3.0-_Lh4Ff/blib/lib/auto/DBD/Pg

      /Users/UserName1/perl5/lib/perl5/darwin-thread-multi-2level/auto/DBD/Pg


      /Users/UserName2/.cpan/build/DBD-Pg-3.3.0-Szwk6r/blib/arch/auto/DBD/Pg

      /Users/UserName2/.cpan/build/DBD-Pg-3.3.0-Szwk6r/blib/lib/auto/DBD/Pg


      And I appended many paths in an effort to connect that which was lost, but that also was lost. For though the installation goes on and on onto the system, the module goes onto User accounts. So it was that the error became evident:

      Can't locate loadable object for module DBD::Pg in @INC (@INC contains:

      /Library/Perl/5.16/darwin-thread-multi-2level

      /Library/Perl/5.16 /Network/Library/Perl/5.16/darwin-thread-multi-2level

      /Network/Library/Perl/5.16

      /Library/Perl/Updates/5.16.2/darwin-thread-multi-2level

      /Library/Perl/Updates/5.16.2

      /System/Library/Perl/5.16/darwin-thread-multi-2level

      /System/Library/Perl/5.16

      /System/Library/Perl/5.16/darwin-thread-multi-2level

      /System/Library/Perl/5.16

      /System/Library/Perl/5.16/DBD-Pg-3.3.0


      .) at /Library/WebServer/CGI-Executables/DBConn.pl line 3.

      For nothing here is the same. But that which is lost cannot be made one with that which seeks until that which is other is made one and the same. For all is one and the truth is one and the same. But my files and configurations are many and various and without order or sameness. Perhaps it would have been better if, when things did not work properly, I had stopped, and thought about what I was doing. But alas, how can we know that which is not yet, or if it would be better to act or to act not.

      And now I wonder even if I should buy another computer and start fresh. Perhaps an iPad.
Re: DBD challenge
by Anonymous Monk on Jun 13, 2014 at 06:40 UTC
Re: DBD challenge
by MBrandonLeavenworth (Initiate) on Jun 13, 2014 at 18:25 UTC
    It works!

    MyFirst Mac/Apache/CGI/perl/Postgres/DBI App

    The main difficulty and complications appears to have been due to the fact that Postgres has made great efforts to ease and simplify the syntax for use with DBD, which is very nice and clear now that I know what I knew not.