in reply to browser time out

You probably want to split off the file writes into a child process:
use strict; # Do lots of stuff write_file(); sub write_file { if (defined (my $pid=fork)) { if ($pid) { # Parent, let's just continue return; } else { # Child, do the file mod stuff. do_write_file(); exit 0; } } else { die "Blerch: could not fork: $!\n"; }
Note that this code is quite unpolished (e.g. the if/else structure could be saner, and you definitely want to set a SIGCHLD handler in your parent to check the return value of the child), but it should get you on your way.

CU
Robartes-