The site doesn't like 'head' requests? get works #!/usr/bin/perl use strict; use warnings;
use LWP::Simple; # my $url="https://shlomif.github.io/"; my $url="http://www.notabug.org/"; print "$url is ", ( (! get($url)) ? "DOWN!!!!" : "up" ), "\n"; $ is_it_up.pl http://www.notabug.org/ is up On Tue, Feb 13, 2018 at 5:25 AM, Manfred Lotz <[email protected]> wrote: > Hi there, > Somewhere I found an example how to check if a website is up. > > Here my sample: > > #! /usr/bin/perl > > use strict; > > use LWP::Simple; > my $url="https://notabug.org"; > if (! head($url)) { > die "$url is DOWN!!!!" > } > > Running above code I get > https://notabug.org is DOWN!!!! at ./check_url.pl line 8. > > > However, firefox shows the site works ok. > > > What am I doing wrong? > > > -- > Thanks, > Manfred > > -- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > http://learn.perl.org/ > > > -- a Andy Bach, [email protected] 608 658-1890 cell 608 261-5738 wk
