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.. |