If the nohup helped your problem then I would assume that
it's some sort of issue with your os handling STDOUT and
STDERR after detaching the terminal. If you are happy
with the nohup solution (a good solution) then you could
leave it, but if you're still interested in tracking down
your bug I would redirect the STDOUT and STDERR to a log
as Fastolfe mentioned a couple posts above. This may also
solve your problem. You could also take a look at the
net::daemon or proc::daemon modules too.