Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: checking a url to make sure it works

by benn (Priest)
on Feb 20, 2004 at 12:37 UTC ( #330528=note: print w/ replies, xml ) Need Help??


in reply to checking a url to make sure it works

You'll probably need to do a few "sanity checks" as well on the entered URL...as you've noticed, if the user inputs "http://www.test.com", then you'll end up trying to fetch "http://http://www.test.com" if you simply add an "http://" to the beginning without checking it first. A simple way round this would be to strip any "http://" part from the entered string with a regex, but for a more solid approach, check out some of the CPAN modules available (such as CGI::Untaint::url) for this task.

Cheers,
Ben.


Comment on Re: checking a url to make sure it works

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (13)
As of 2014-10-23 12:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls