“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web
my @urllist = ('http://www.fee.org/','http://www.fie.org/','http://www.foe.org/','http://www.fum.org/');
# equivalent
my $urltofind = 'http://www.fee.org/';
# written another way...
if (grep {m|^$urltofind?$|} @urllist) { print "It's in there!\n" }
# grep will search @urllist for zero or one (?) occurances of $urltofind
my @urllist = ('http://www.test.com/');
my $urltofind = 'http://www.url.com/';
if (grep {m|^$urltofind?$|} @urllist) { print "It's in there!\n" } $urltofind
EDIT:
I tried at first:
my @urllist = ('http://www.unitedff.com/');
my $urltofind = 'http://www.fantasysquare.com/';
if (grep {m|^$urltofind?$|} @urllist) { print "It's in there!\n" }
else { print "check failed\n"; } $urltofind
and it printed check failed even thougn fantasysquare.com is in the source code of unitedff.com. Then I tried:
my $urlist = "http://www.unitedff.com/';
my $urltofind = "http://www.fantasysquare.com/';
if (grep {m|^$urltofind?$|} $urllist) { print "It's in there!\n"; }
else { print "lol\n"; }
and I got an internal server error
Last edited by Sephiroth32; 03-13-2003 at 04:34 PM.
lol I know how to view the source manually :P but there is no way to check the source? oh well. I have seen link checking scripts though they must do it somehow..
also this made me realize how little I really know about CGI. I know the basics and everything but is thete some online tutorials I can go to to learn more?
use LWP::Simple;
my $source = get('http://www.w3.org/'); # get(....) ???
if ($source =~ m|http://(?:www\.)?yoursite\.com/?|) { print 'Yup'; }
else { print 'Nope'; }
What does this do?
I think what Sephiroth32 is asking for is some technique to download someone else's Perl code off thier server, which, as far as I know, is impossible!
Bookmarks