Hi,
I installed a number of scripts that work quite well on my server but I do get an error message "Sorry, can't open database file." The directoery database as well as the file database.txt have 644 permissions. Here is part of the script:

sub search_files { if ($USE_DBM) { while (($file, $file_path) = each(%f_file_db)) { search_contents($file, $file_path); } } else { my $file_count = 0; open (FILEDB, $DATABASEFILE) || die "Sorry, can't open databas +e file.\n"; foreach (<FILEDB>) { $file_count++; ($f_file_db{$file_count}, $filenames_db{$file_count}, $f_d +ate_db{$file_count},$f_size_db{$file_count},$f_termcount_db{$file_cou +nt},$descriptions_db{$file_count},$titles_db{$file_count},$contents_d +b{$file_count},$alt_text_db{$file_count},$meta_description_db{$file_c +ount},$meta_keywords_db{$file_count},$meta_author_db{$file_count},$li +nks_db{$file_count}) = split /\t/, $_; my $filepath = $f_file_db{$file_count}; search_contents($file_count, $filepath); } close(FILEDB); } }

I appreciate any and all suggestions of a possible solution. Thanks,
Karl

In reply to Database file does not open by Karlmann

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.