I am getting a strange error when I am trying to create a dbm file. My code will run for a long while and then will crash with the following error:

ndbm store returned -1, errno 27, key "SND2002020000018" at ./ResetLinks.pl line 72

The following is a snippet from my code showing how I am creating the file.
$link_file_name = "$THIS_APP_DIR/d_link/ini/g166Links"; $link_dir_file = "$THIS_APP_DIR/d_link/ini/g166Links.dir"; $link_pag_file = "$THIS_APP_DIR/d_link/ini/g166Links.pag"; # Create new link database files if ( dbmopen(%INI_records,$INI_file_name,0666) && dbmopen(%link_records, $link_file_name, 0666) ) { my @all_files, $loop, $loop2, @loop3; my $i=0; # get list of files from data directory foreach $loop (sort `cd $data_dir; ls -d *`) { chop($loop); foreach $loop2 (sort `cd $data_dir; ls -d $loop/*`) { chop($loop2); foreach $loop3 (sort `cd $data_dir; ls -d $loop2/*`) { chop($loop3); $all_files[$i++]=$loop3; } } } foreach my $data_path (sort @all_files) { print "processing file $data_path\n"; $data_path =~ s/[\n\r]//g; my ($this_table,$blank,$file) = split(/\//,$data_path); my ($key_field_name,$function_name) = split (/::/,$INI_records{$this_table}); my $key_field = &get_key_field ($data_path,$key_field_name,$function_name); my $this_file_id = $this_table . "." . $file; if ( $key_field gt "" ) { if ( ! defined $link_records{$key_field} ) { $link_records{$key_field} = $this_file_id; } else { ???? if (length($link_records{$key_field}) + length($this_file_id) < 998) { $link_records{$key_field} .= "::" . $this_file_id; } } }
I marked the line that is flagged by the error (????). The files get very large so I'm thinking that this is a size issue. Any suggestions would be appreciated.

Thanks, Kevin

In reply to Error creating database file by krivenburg

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.