in reply to Database file does not open

Get more specific error details by printing the value of $!:
open (FILEDB, $DATABASEFILE) || die "<b>Sorry, can't open database fil +e. $?</b>\n";

On a side note, please change the title of your post: How do I compose an effective node title?.

Update: I incorrectly mentioned $?, but I meant to say $!. Thanks, NetWallah.

Replies are listed 'Best First'.
Re^2: help, please!
by NetWallah (Canon) on Mar 14, 2010 at 04:54 UTC
    Suerly, you mean "$!" , not "$?".

    To be canonical, the open should be:

    open (FILEDB, "<", $DATABASEFILE) or die "<b>Sorry, can't open data +base file $DATABASEFILE:<br/>$!</b>";
    $? deals with errors from child processes.
    $! deals with OS errors, including file open errors.

         Theory is when you know something, but it doesn't work.
        Practice is when something works, but you don't know why it works.
        Programmers combine Theory and Practice: Nothing works and they don't know why.         -Anonymous

      Thank you very much, Net. The script cannot find the text file and I have now something to work with. Your help is much appreciated.
      Karl I forgot a closing forward slash on the path to the directory with the result that it was looking for the directorytextfile.txt as the file name. Adding this $! is a great idea. Thanks again!
Re^2: help, please!
by Karlmann (Initiate) on Mar 14, 2010 at 04:46 UTC
    Thanks for the help and also for the title criticism. It's appreciated. I did as suggested but still get the same error without any more specifics.
      Correction. I get the following error message:
      Sorry, can't open database file. 0
      My next question: What does this zero mean? Thanks,
      Karl