in reply to can't call method 'protocol'

The problem is that CGI and LWP::Simple import a head method into your namespace. A quick fix is to call
my $response = LWP::Simple::head($url);
instead of just head. A better fix is to use the object syntax of CGI.
Boris