Checking if URL is valid/exist using PERL 
Author Message
 Checking if URL is valid/exist using PERL

vanja> Is it possible to check if URL is valid (if it exists) using
vanja> PERL?  I am sure that I have seen something about that topic on
vanja> Dejanews few days ago, but there's no way in hell I can find
vanja> that message again.

vanja> If someone can point me to any direction...

Yes:

        use LWP::Simple;
        print "it's valid" if get $url;

Can't be much simpler than that.

--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying

Web: <A HREF=" http://www.*-*-*.com/ ;>My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me



Thu, 25 Jan 2001 03:00:00 GMT  
 Checking if URL is valid/exist using PERL

MCMXCIII in <URL: :">

++
++ vanja> Is it possible to check if URL is valid (if it exists) using
++ vanja> PERL?  I am sure that I have seen something about that topic on
++ vanja> Dejanews few days ago, but there's no way in hell I can find
++ vanja> that message again.
++
++ vanja> If someone can point me to any direction...
++
++ Yes:
++
++      use LWP::Simple;
++      print "it's valid" if get $url;
++
++ Can't be much simpler than that.

Really? Then what's all this mumble-jumble about validating email
addresses?  Mailto: URLs are just a small subset of the possible
URLs. Furthermore, just because you cannot get a certain HTTP url doesn't
mean the URL isn't valid/non-existing - partly for the same reasons you
cannot validate email addresses.

Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))



Fri, 26 Jan 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Checking if a url is valid

2. How do I check for a valid URL

3. Checking if a URL exists in Perl

4. Check if a URL exists

5. Check for valid perl regex

6. Best way to determine if URL is valid

7. Testing for valid URL before writing HTML code (cgi)

8. valid URL regexp

9. Check for valid hex value

10. checking if mail address is valid

11. checking for a valid date-time

12. A Script for checking emails valid?

 

 
Powered by phpBB® Forum Software