Checking if a URL exists in Perl 
Author Message
 Checking if a URL exists in Perl

Quote:

> I have a problem, and I cannot seem to overcome it.
> I have a form in which the users add a url, and the cgi is supposed to check
> if the url exists, and if
> so, index it. Otherwise, throw an exception or something.. But I can't seem
> to find how to check if
> the file exists. Can you help me?

There is no reliable way to do this.
You can only check if a URL is accessible at a particular
point of time.  Use LWP::UserAgent or LWP::Simple
to do this.
--


Wed, 18 Jun 1902 08:00:00 GMT  
 Checking if a URL exists in Perl
Hi !
I have a problem, and I cannot seem to overcome it.
I have a form in which the users add a url, and the cgi is supposed to check
if the url exists, and if
so, index it. Otherwise, throw an exception or something.. But I can't seem
to find how to check if
the file exists. Can you help me?

Greetings,
- Yuval



Wed, 18 Jun 1902 08:00:00 GMT  
 Checking if a URL exists in Perl
Yuval Kalev schrieb:

Quote:
> Hi !
> I have a problem, and I cannot seem to overcome it.
> I have a form in which the users add a url, and the cgi is supposed to check
> if the url exists, and if
> so, index it. Otherwise, throw an exception or something.. But I can't seem
> to find how to check if
> the file exists. Can you help me?

Try the Module LWP::Simple (or LWP::UserAgent for more advanced things)

Jonas



Wed, 18 Jun 1902 08:00:00 GMT  
 Checking if a URL exists in Perl

MCMXCIII in <URL::">
"" Hi !
"" I have a problem, and I cannot seem to overcome it.
"" I have a form in which the users add a url, and the cgi is supposed to check
"" if the url exists, and if
"" so, index it. Otherwise, throw an exception or something.. But I can't seem
"" to find how to check if
"" the file exists. Can you help me?

I am confused by this question. The user "adds" a URL, then the "cgi"
(I presume you mean 'a program using CGI to interface with the server',
 as CGI is a protocol, on a program) checks whether the URL exists
(I'm not sure what you mean by "a URL exists" - you probably have in your
mind some restricted definition of "URL", and some idea what "exists"
means) and then you suddenly make the leap to "check if the file exists".

The answer to the latter is trivially found in the manual, so I won't
bother telling you. But what has that to do with URLs?

Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi

  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----



Wed, 18 Jun 1902 08:00:00 GMT  
 Checking if a URL exists in Perl

MCMXCIII in <URL::">

Really? Is LWP::Simple going to tell me anything about FTP urls? How about
mailto? news? nntp? telnet? gopher? prospero? wais? mid? nfs? ldap? imap?
z39_50? cid? vemmi?

Abigail
--
perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
          print chr 0x$& and q
          qq}*excess********}'

  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Checking if URL is valid/exist using PERL

2. Check if a URL exists

3. Checking URL's for 404 Errors in Perl CGI

4. How to check a URL adress in Perl ?

5. Please advise on URL robot checking PERL modules

6. Question - how to check if an object method exists

7. Use CGI to check against existing .htaccess/.passwd files

8. Checking whether file exists

9. existing spell-check code??

10. Checking To See If File Exists

11. Checking a window exists?

12. checking for existing within a list

 

 
Powered by phpBB® Forum Software