my $str = shift @_; my $uri = URI->new($str); $uri->scheme('http') unless $uri->scheme; ...