in reply to Identifying a Malformed URI

You could use the URI module, which is part of LWP, and validate that way. You should check to see if it understood your request.
use URI; my $uri = new URI ($some_uri);
Then you can examine the contents of it to see if they are OK. Otherwise, you can use the "official" regexp to parse them. This is taken from the URI man page:
my($scheme, $authority, $path, $query, $fragment) = $uri =~ m|^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#( +.*))?|;