in reply to Is recursion consistent with "use warnings"

The issue is that a prototype only gets associated with the subroutine after it has finished compiling; so by the time the compiler encounters the check_ip() inside the sub, it knows that check_ip() has a prototype, but it doesn't know which one yet.

As suggested by other posters, either drop the prototype (which doesn't buy you anything in the way you're using it), or declare the sub before defining it.

Note however that you still may get a warning - if your eval keeps failing, you'll hit a trigger that warns you for possible infinite recursion. Your sub is easily coded without recursion:

sub check_ip { { my $ip = eval { # Indirect object calls are so last millenium Net::IP->new(`curl whatismyisp.org`)->ip; }; return $ip if defined $ip; sleep 300; redo; } }
Of course, one can easily make a loop using while (or until), or even a goto as well.