in reply to Cann't create a file

Thank you all for your input. I tried both variations using "or" instead of || and () when using ||. Both caused my server to reboot. Go figure. Back to the drawing board.

Chris.

Replies are listed 'Best First'.
Re^2: Cann't create a file
by monarch (Priest) on Jul 14, 2005 at 23:41 UTC
    First, use the open( ... ) form of the function.. given the issues with operator precedence it would be very wise to use the parenthesis (also known as brackets).

    Second, if your server is rebooting I highly recommend pulling out the debugger. perl -d<script>. Then single step through each line until you hit the one that makes your server reboot.

    If you're using CGI through Apache and don't have the option of running a debugger, then one approach you might take to finding the line causing the issue is sprinking sleeps and debugging statements.. e.g.

    $| = 1; # turn on autoflushing of print statements print( "<p>About to open file..</p>" ); sleep( 5 ); open( ... ) or die( ... ); print( "<p>About to append to file..</p>" ); sleep( 5 ); print FILEHANDLE $statement; ...
    and soforth..