Perl Mechanize Error GETing (Bad file descriptor)

60 Views Asked by At

Consider this short piece of code:

use strict;
use warnings;
use WWW::Mechanize;

my $mech = WWW::Mechanize->new();
$mech->get("https://www.flightaware.com/live/airport/KCLE");
my $content = $mech->content();

print "$content\n";

It produces an error:

Error GETing https://www.flightaware.com/live/airport/KCLE: Can't connect to www.flightaware.com:443 (Bad file descriptor) at line 6.

How can I improve upon this code for success?

Thank you in advance.

0

There are 0 best solutions below