From afd07bcd57bcd0685d4fb2fc60bbfc9fb1908d0c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 13 Apr 2023 11:37:39 -0700 Subject: [PATCH] Bump minimum Perl version to 5.20 for signatures feature --- cpanfile | 2 +- lib/PBot/Imports.pm | 9 ++++++--- lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm | 3 +-- lib/PBot/VERSION.pm | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cpanfile b/cpanfile index 3871c0ba..d46e9148 100644 --- a/cpanfile +++ b/cpanfile @@ -7,7 +7,7 @@ # Install a fully featured PBot (without Windows compiler-vm support): # cpanm -n --installdeps . --with-all-features --without-feature compiler_vm_win32 -requires 'perl' => '5.010001'; +requires 'perl' => '5.020000'; # PBot core requires 'Cache::FileCache'; diff --git a/lib/PBot/Imports.pm b/lib/PBot/Imports.pm index d8846d8f..8dec7c62 100644 --- a/lib/PBot/Imports.pm +++ b/lib/PBot/Imports.pm @@ -19,13 +19,16 @@ sub import { warnings->import::into($target); # use feature ':5.16' - feature->import::into($target, ':5.16'); + feature->import::into($target, ':5.20'); # use utf8 utf8->import::into($target); - # no if $] >= 5.018, warnings => 'experimental'; - warnings->unimport::out_of($target, 'experimental') if $] >= 5.018 + # use signatures + feature->import::into($target, 'signatures'); + + # no warnings => 'experimental'; + warnings->unimport::out_of($target, 'experimental'); } sub unimport { diff --git a/lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm b/lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm index 9b24de7a..479e456a 100644 --- a/lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm +++ b/lib/PBot/Plugin/Quotegrabs/Storage/SQLite.pm @@ -127,7 +127,6 @@ sub get_random_quotegrab($self, $nick, $channel, $text) { push @params, '%' . $text . '%'; $joiner = ' AND'; } -$self->{pbot}->{logger}->log("$sql $joiner id NOT IN Seen ORDER BY RANDOM() LIMIT 1\n"); # search for a random unseen quotegrab my $sth = $self->{dbh}->prepare("$sql $joiner id NOT IN Seen ORDER BY RANDOM() LIMIT 1"); $sth->execute(@params); @@ -162,7 +161,7 @@ sub remove_seen($self, $sql, $params) { $sql =~ s/^SELECT \*/SELECT id/; my $count = eval { - my $sth = $self->{dbh}->prepare("DELETE from Seen WHERE id IN ($sql)"); + my $sth = $self->{dbh}->prepare("DELETE FROM Seen WHERE id IN ($sql)"); $sth->execute(@$params); return $sth->rows; }; diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 5c6948e4..dc64f73a 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4644, + BUILD_REVISION => 4645, BUILD_DATE => "2023-04-13", };