in reply to Detach from terminal

Nevermind. I decided to try a fork and that seems to work well.

my $pid = fork(); exit(1) if $pid < 0; exit(0) if $pid > 0;