in reply to Re: DB open segfault
in thread DB open segfault
use CgiLib; use ScmConf; use ScmLib; use LWP::Simple; use AnyDBM_File; &ScmConf::Init(); $starting_time = time; &PrintHead(*STDOUT,"Document Index", ""); &ReadParse() || &PrintErrorMessage("Error in parameter list"); $key = $input{"key"}; $key =~ s/\s*$//; ($search_string = $key) =~ s/-/ /g; $selected_category = $input{"category"}; @selected_status = split(",", $input{"status"}); if ($key =~ /^\w\w\w ?\d\d\d\d\d[ \w]*$/) { print "<br><strong>Note</strong>: Search time can be greatly improve +d if a document number is specified using dashes '-' between prefix, +regnumber, variant and doctype<br><br>\n"; } print "<table style=\"border: 1px solid #666666; margin-left: 20px; ma +rgin-right: 20px;\" cellpadding=\"2\" cellspacing=\"4\">\n"; print " <tr>\n"; print " <th class=\"colheader\">Number<br><nobr>[Document Info]</no +br></th>\n"; print " <th class=\"colheader\">Title<br>[Document]</th>\n"; print " <th class=\"colheader\">Author</th>\n"; print " <th class=\"colheader\">Status</th>\n"; print " <th class=\"colheader\">Last Updated</th>\n"; print " </tr>\n"; &flush(); my $count = 0; my $count2 = 0; my @result; tie(%DOC, 'AnyDBM_File', &documentdb, O_RDONLY, 0664);
and it generates the error: Segmentation fault (core dumped)my $db = shift(@ARGV); my $file = shift (@ARGV); my (%DOC); open (SAL, ">$file"); dbmopen (%DOC, $db, 0666); foreach $keys (%DOC) {@a = split ('\0', $DOC{$keys}); $q = join ('-',@a); print SAL $keys ."=".$q."\n";} dbmclose (%DOC); close (SAL); exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: DB open segfault
by alexm (Chaplain) on Jan 09, 2008 at 17:15 UTC |