in reply to Re^2: Dancer and forking
in thread Dancer and forking

The forked child process is meant to return the content, not to the parent process, but to the connected client. The exit causes all open file handles to be flushed and closed. Thus the content is delivered to the client.

Without the exit, the forked child would continue to execute the parent's code after returning from the anonymous sub.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Replies are listed 'Best First'.
Re^4: Dancer and forking
by Anonymous Monk on Apr 30, 2018 at 11:42 UTC
    And because the filehandles which are sshared have been opened by the parent still at large are shares with the child so when closing up with exit the stdout is delivered to the client/browser?