in reply to Perl EV script always closed with no warnings and error

Is the server 'just dying', even when doing nothing and just sitting there?
Are there any requests hitting the server, do you maye monitor (tcpdump?) port 8080?
On what platform are you?

Your code compiles and runs without any hickup on my WS (Linux, Fedora 25), but I'm not sure how to try to reproduce what might be hitting you.