M
Martin Lee
I read Intermediate Perl today, and I found a piece of code that is:
use HTTP::SimpleLinkChecker qw(check_link);
my @good_links = grep {
check_link( $_ );
! $HTTP::SimpleLinkChecker::ERROR;
} @links;
and I modify this code , like this:
use HTTP::SimpleLinkChecker qw(check_link);
@links = ("http://www.google.com", "http://www.facebook.com", "http://mcnvakdlectter.com")
my @good_links = grep {
check_link( $_ );
! $HTTP::SimpleLinkChecker::ERROR;
} @links;
print "$_\n" for @good_links;
the "mcnvakdlectter.com" is a wrong url, but I get this when I execute this code:
http://www.google.com
http://www.facebook.com
http://mcnvakdlectter.com
I refer to the usage of HTTP::SimpleLinkChecker, this module can get the HTTP response code, I test with http://mcnvakdlectter.com and it return 500, but I
don't know why this url is in @good_links , it's a broken websit!!
PS:
Could you tell me the mean of "! $HTTP::SimpleLinkChecker::ERROR;" in the last code?
Thank you very much!
use HTTP::SimpleLinkChecker qw(check_link);
my @good_links = grep {
check_link( $_ );
! $HTTP::SimpleLinkChecker::ERROR;
} @links;
and I modify this code , like this:
use HTTP::SimpleLinkChecker qw(check_link);
@links = ("http://www.google.com", "http://www.facebook.com", "http://mcnvakdlectter.com")
my @good_links = grep {
check_link( $_ );
! $HTTP::SimpleLinkChecker::ERROR;
} @links;
print "$_\n" for @good_links;
the "mcnvakdlectter.com" is a wrong url, but I get this when I execute this code:
http://www.google.com
http://www.facebook.com
http://mcnvakdlectter.com
I refer to the usage of HTTP::SimpleLinkChecker, this module can get the HTTP response code, I test with http://mcnvakdlectter.com and it return 500, but I
don't know why this url is in @good_links , it's a broken websit!!
PS:
Could you tell me the mean of "! $HTTP::SimpleLinkChecker::ERROR;" in the last code?
Thank you very much!