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

sorry,what do you mean?

Replies are listed 'Best First'.
Re^3: Dancer and forking
by shmem (Chancellor) on Apr 30, 2018 at 10:24 UTC

    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'
      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?
Re^3: Dancer and forking
by 1nickt (Canon) on Apr 30, 2018 at 10:41 UTC

    Apologies, had no time earlier. Answer updated. And thanks shmem for jumping in in the meantime!


    The way forward always starts with a minimal test.