This is a good technique but remember that some hosts do not return head requests at all and others don't return requests made by the generic agent name in LWP::Simple. It's not a long list of hosts but it happens. So, if you're having problems, also try a get() and if that's still not it, try LWP::UserAgent and define your own agent name.
The previous example is much easier though.