Fix breakage - code assumed xkcd would never reach 1000th comic :)
Index: lib/XKCD/Core.pm
--- lib/XKCD/Core.pm.orig
+++ lib/XKCD/Core.pm
@@ -37,8 +37,8 @@ sub new {
 sub GetTotal {
     my $self = shift;
     my $progressbar = shift;
-    my $content = _GetData('http://xkcd.com', $progressbar) || return 0;
-    $content =~ / http:\/\/xkcd.com\/(\d{1,3})\//;
+    my $content = _GetData('https://xkcd.com', $progressbar) || return 0;
+    $content =~ / https:\/\/xkcd.com\/(\d{1,5})\//;
     $self->{total} = $1;
     $self->{number} = $self->{total};
     return $self;
@@ -48,7 +48,7 @@ sub GetFavicon {
     my $self = shift;
     my $file = shift || "/tmp/xkcdicon.ico";
     return $file if ((-e $file) && (-s $file > 0));
-    my $content = _GetData('http://xkcd.com/favicon.ico');
+    my $content = _GetData('https://xkcd.com/favicon.ico');
     if ($content) {
     	open (ICON, ">" . $file);
     	print ICON $content;
@@ -62,7 +62,7 @@ sub GetLogo {
     my $progressbar = shift;
     my $file = shift || "/tmp/xkcdlogo.png";
     return $file if ((-e $file) && (-s $file > 0));
-    my $content = _GetData('http://xkcd.com/static/xkcdLogo.png', $progressbar);
+    my $content = _GetData('https://xkcd.com/static/xkcdLogo.png', $progressbar);
     if ($content) {
     	open (ICON, ">" . $file);
     	print ICON $content;
@@ -88,8 +88,8 @@ sub GetNext {
 sub GetRandom {
     my $self = shift;
     my $progressbar = shift;
-    my $content = _GetData('http://dynamic.xkcd.com/comic/random/', $progressbar);
-    $content =~ / http:\/\/xkcd.com\/(\d{1,3})\//;
+    my $content = _GetData('https://dynamic.xkcd.com/comic/random/', $progressbar);
+    $content =~ / https:\/\/xkcd.com\/(\d{1,5})\//;
     $self->{number} = $1;
     return $self;
 }
@@ -98,10 +98,10 @@ sub GetDirectLink {
     my $self = shift;
     my $progressbar = shift;
     return 0 if (!($self->{number}));
-    my $content = _GetData("http://xkcd.com/" . $self->{number} . "/", $progressbar);
-    $content =~ /(http:\/\/imgs.xkcd.com\/comics\/[A-Za-z0-9()_-]+.[png|jpg|gif]+)/;
+    my $content = _GetData("https://xkcd.com/" . $self->{number} . "/", $progressbar);
+    $content =~ /(https:\/\/imgs.xkcd.com\/comics\/[A-Za-z0-9()_-]+.[png|jpg|gif]+)/;
     $self->{link} = $1;
-    $content =~ /<img src="(http:\/\/imgs.xkcd.com\/comics\/[A-Za-z0-9()_-]+.[png|jpg|gif]+)" title="(.+?)" alt="(.+?)" \/>/;
+    $content =~ /<img src="(https:\/\/imgs.xkcd.com\/comics\/[A-Za-z0-9()_-]+.[png|jpg|gif]+)" title="(.+?)" alt="(.+?)" \/>/;
     $self->{description} = $2;
     $self->{title} = $3;
     return $self;
@@ -112,7 +112,7 @@ sub SaveImage {
     my $file = shift || "/tmp/xkcd" . $self->{number} if ($self->{number});
     my $progressbar = shift;
     $self->{file} = $file;
-    if (($file) && (-e $file) && ($file =~ /xkcd\d{1,3}/)) {
+    if (($file) && (-e $file) && ($file =~ /xkcd\d{1,5}/)) {
         return $file;
     }
     $self->GetDirectLink || return 0;
@@ -166,7 +166,7 @@ sub Search {
     my $progressbar = shift;
     my $num_pages = 1;
 
-    my $content = _GetData("http://www.ohnorobot.com/index.pl?e=0;show=advanced;n=0;m=0;d=0;s=" . $search . ";p=" . $num_pages  . ";Search=Search;b=0;comic=56;t=0", $progressbar);
+    my $content = _GetData("https://www.ohnorobot.com/index.pl?e=0;show=advanced;n=0;m=0;d=0;s=" . $search . ";p=" . $num_pages  . ";Search=Search;b=0;comic=56;t=0", $progressbar);
     my $page_regex = 'p=(\d{1,5})';
     my %results;
     my @pages;
@@ -197,8 +197,8 @@ sub Search {
 sub _GetResults {
     my $search = shift || return;
     my $current_page = shift || 1;
-    my $content = _GetData("http://www.ohnorobot.com/index.pl?e=0;show=advanced;n=0;m=0;d=0;s=" . $search . ";p=" . $current_page  . ";Search=Search;b=0;comic=56;t=0");
-    my $search_regex = '<p><a class="searchlink" href="http:\/\/xkcd.com\/(\d{1,3})\/">(.+?)<\/a><\/p>';
+    my $content = _GetData("https://www.ohnorobot.com/index.pl?e=0;show=advanced;n=0;m=0;d=0;s=" . $search . ";p=" . $current_page  . ";Search=Search;b=0;comic=56;t=0");
+    my $search_regex = '<p><a class="searchlink" href="https:\/\/xkcd.com\/(\d{1,5})\/">(.+?)<\/a><\/p>';
     my %results;
 
     while ($content =~ /$search_regex/) {
@@ -249,7 +249,7 @@ sub SetNumber {
     my $self = shift;
     if (@_) {
         my $new_num = shift;
-        $self->{number} = $new_num if (($new_num =~ /\d{1,3}/) && ($new_num <= $self->{total}));
+        $self->{number} = $new_num if (($new_num =~ /\d{1,5}/) && ($new_num <= $self->{total}));
     }
     return $self;
 }
@@ -300,7 +300,7 @@ NOTE: $progressbar must be a Gtk::ProgressBar object
 =head1 DESCRIPTION
 
 Using this module you can obtain informations from
-http://xkcd.com.
+https://xkcd.com.
 You can get comic's:
   * images
   * direct link to image
