Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Identifying a Malformed URI

by tadman (Prior)
on Aug 10, 2001 at 07:07 UTC ( [id://103749]=note: print w/replies, xml ) Need Help??


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|^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#( +.*))?|;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://103749]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-06-12 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.