in reply to Re^2: URI Module can't find method
in thread URI Module can't find method

Are you sure $a will only be that? For example, 'ftp://blah.com' and 'https://somewhere.com' are valid strings for a URI which would blow up in your example since they use different schemes other than 'http'.

Perhaps a better strategy would be to let the URI module do that work for you since that's what it does best:

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

Cheers,
Matt