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

Server error!

Error message:

Can't locate object method "TIEHASH" via package "" at /opt/lampp/cgi-bin/perlfect/search.pl line 78.,

Anyone could help me solve this problem?!

Regards John

Replies are listed 'Best First'.
Re: Error cannot locate TIEHASH
by Corion (Patriarch) on Dec 24, 2009 at 10:12 UTC

    You trie to tie a variable to an empty class. You haven't shown the code, but likely, line 78 looks like:

    tie %foo, '', ...
    or
    tie %foo, $bar, ... # and $bar is empty

    So you will now have to find out why you're trying to tie something to the empty class (the main program). Likely, you're just missing the tie-class parameter in that line.

Re: Error cannot locate TIEHASH
by gmargo (Hermit) on Dec 24, 2009 at 10:31 UTC

    You don't give us much to go on here. How (Not) To Ask A Question

    Guessing from the directory name /perlfect/ and a little Google... Is this file ".../perlfect/search.pl" from the http://www.perlfect.com/freescripts/search/ source code?

    Here are lines 77 and 78 of search.pl. I'd guess $db_package is blank and you have a configuration problem.

    tie %inv_index_db, $db_package, $INV_INDEX_DB_FILE, O_RDONLY, 0755 or +die "Cannot open $INV_INDEX_DB_FILE: $!"; tie %docs_db, $db_package, $DOCS_DB_FILE, O_RDONLY, 0755 or die " +Cannot open $DOCS_DB_FILE: $!";
      yes correct. where should i look for to solve this problem. how can i solve the problem? Thank you all for your helpp! regards John

        Is it possible that you do not have DB_File installed? Or you've configured for some other database module that is not installed?

        look on line 78 to see which hash you're trying to tie