The eval strategy should work, if the package is indeed throwing an exception (which eval will catch). But, notice that in the example code above, the value of $@ was printed. So, the message would appear to “still show up,” even though this time it’s coming from that print statement.
Add two different print statements, one to if part and a different one to the else part, so that you can clearly see which one was executed.
It is proper behavior for the package to have thrown an exception (i.e. die()) in a case where, due to not being connected to the Internet (and therefore having no “local IP-address” at all), no value could sensibly be returned. You just have to catch that exception, and eval should do that.