I am using LWP to parse a website from a url collected via a form. I want to know if it's possible to check to see if the URL exists. I get weird situtations where sometimes if they use the space bar it will run as if they input a url, if they input http:// first (since I add it myself), it can't find the url. And if they add something like "324242342543" or "test.com" it tries to find it from my server and prints out "myserver.com". So I'm confused, I know
defined doesn't check for url validity, is there something else I can try? And if I have to go with modules, I really need it to be one that's commonly installed rather than one I have to download.
I don't want to see if the url looks good, since I am parsing the webpage they provide for text, I need to say "Okay, the page is found..let's work" or "Nope, page can't be found so let's terminate".
my $geturl = "http://$url";
my $content = get("$geturl");
unless (defined $content)
{
print "<center>URL not found!</center><br><br>";
exit;
}