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"; }