In attempting to tie a DB_File with:
my $path_to_file= "/tmp/foo.db"; my $result= {}; tie %$result, "DB_File", $path_to_file, O_RDWR|O_CREAT, 0666, $DB_TREE + or die "Error: $!";

I was getting "Error: File exists" when the file did not. However, I found the file "/tmp/__foo.db" did exist. Does this mean that DB_File is creating this file and it is being left around when the script does not clean up?

If my assumption is correct, I would like to know so that I can make sure I clean up those files if they exist after a crash or unpredicted shutdown.

The reason the script is not cleaning up is that it is being started in inittab (Linux) with respawn and it is exiting for no apparent reason.

# inittab 1:45:respawn:/path/start.sh # start.sh # deal with old log files and then cd /proper_place /proper_place/script.pl > /logs/stdout 2> /logs/stderr
I'm logging stderr and stdout but I get nothing in either. Any thoughts on either problem would be greatly appreciated.


In reply to DB_File problem by Woulfe

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.