in reply to Re: Perlfect aborted when loading DB_file.pm
in thread Perlfect aborted when loading DB_file.pm

First, Thanks alot for your help!
# perl -MDB_file -e1 Can't locate DB_file.pm in @INC (@INC contains: /etc/perl /usr/local/l +ib/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_pe +rl .). BEGIN failed--compilation aborted.

Thats the error I got. And on installation, i first installed Berkeley as DB_file required db.h to /usr/local/contrib/include and ../lib. And i configured config of DB_File.pm to point to db.h and did a make install. I actually am not too sure when i should put DB_file.pm Any suggestion greatly appreciated! :)

Replies are listed 'Best First'.
Re^3: Perlfect aborted when loading DB_file.pm
by Corion (Patriarch) on Dec 26, 2009 at 22:23 UTC

    Perl distinguishes between DB_file and DB_File. The module is named DB_File, so you better check again using:

    perl -MDB_File -e1

    Also, I don't really understand your description of your installation. Did install DB_File via the CPAN tool or do:

    perl Makefile.PL make make test make install

    (the two are roughly equivalent) or did you do another form of "install"?

Re^3: Perlfect aborted when loading DB_file.pm
by Khen1950fx (Canon) on Dec 26, 2009 at 22:33 UTC
    Note: It's "DB_File"--not "DB_file". As Corion said, DB_File is part of the core since the beginning of perl5. It's also dualLived, so it can be updated.

    I can't find anything essentially wrong with DB_File nor search.pl; however, the README in the source emphatically says to use ssh/telnet. HTTP can lead to breaches of security and "should be used only when absolutely necessary".

      # perl -MDB_File -e1 gave me an empty result back. And installation was

      perl Makefile.pl make make test make install
      which installed without errors.

      Also, tes via ssh, i get it perfectly well, both indexer.pl & search.pl. I am only trying to get search.pl in cgi-bin dir worked so people could search via http.

      Thank you all alot for your help! Regards, John

        This is weird, because your error message says that DB_File.pm contains a syntax error. Maybe the Perl that is run by your webserver to run your script is a different Perl than the one you get through ssh. I suggest removing all other code from your search.pl (or better, creating a new file) that only has the lines

        #!/usr/bin/perl -w use CGI::Carp 'fatalsToBrowser'; use DB_File; print "DB_File is OK\r\n";

        in it, to see whether DB_File on itself loads OK.