# do startup/initialization code ... if (my $pid = fork()) { print "Sending to background...\n"; exit(0); } ... # main application code here