in reply to LWP::Daemon barf on bad DNS

Can I just put a 'try' around it?

Without knowing what your code looks like (SSCCE!), I'd say yes, try (e.g. from Try::Tiny or a modern Perl) is a standard way to catch errors like this and to have your code continue after handling the error. It also depends a bit on how your script is being run and how often this happens, if it doesn't happen all too often and you're running your script as a daemon, note there are process managers that will automatically restart crashed daemons.

Update: Since your last question was about RPi, is this on an RPi? Because there, since Raspbian already runs systemd, I just use that to manage my daemons. For example, here's a .service file I used on a project that used a Mojolicious webserver on an RPi:

# Docs: https://wiki.debian.org/systemd/Services # Set me up via: # $ sudo ln -s /home/pi/project/my_web.service /etc/systemd/system/ # $ sudo systemctl daemon-reload # $ sudo systemctl enable my_web # $ sudo systemctl start my_web [Unit] Description=My Web Service After=network.target [Service] Type=simple Restart=always Environment="PERL5LIB=/home/pi/perl5/lib/perl5" User=pi Group=pi ExecStart=/home/pi/project/web_app.pl daemon -m production -l http://* +:8080 [Install] WantedBy=multi-user.target

You can customize how the service gets managed, e.g. with things like KillSignal=SIGINT or RestartSec=30.