3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-25 21:39:27 +01:00

Bump minimum Perl version to 5.20 for signatures feature

This commit is contained in:
Pragmatic Software 2023-04-13 11:37:39 -07:00
parent 3180d11303
commit afd07bcd57
4 changed files with 9 additions and 7 deletions

View File

@ -7,7 +7,7 @@
# Install a fully featured PBot (without Windows compiler-vm support): # Install a fully featured PBot (without Windows compiler-vm support):
# cpanm -n --installdeps . --with-all-features --without-feature compiler_vm_win32 # cpanm -n --installdeps . --with-all-features --without-feature compiler_vm_win32
requires 'perl' => '5.010001'; requires 'perl' => '5.020000';
# PBot core # PBot core
requires 'Cache::FileCache'; requires 'Cache::FileCache';

View File

@ -19,13 +19,16 @@ sub import {
warnings->import::into($target); warnings->import::into($target);
# use feature ':5.16' # use feature ':5.16'
feature->import::into($target, ':5.16'); feature->import::into($target, ':5.20');
# use utf8 # use utf8
utf8->import::into($target); utf8->import::into($target);
# no if $] >= 5.018, warnings => 'experimental'; # use signatures
warnings->unimport::out_of($target, 'experimental') if $] >= 5.018 feature->import::into($target, 'signatures');
# no warnings => 'experimental';
warnings->unimport::out_of($target, 'experimental');
} }
sub unimport { sub unimport {

View File

@ -127,7 +127,6 @@ sub get_random_quotegrab($self, $nick, $channel, $text) {
push @params, '%' . $text . '%'; push @params, '%' . $text . '%';
$joiner = ' AND'; $joiner = ' AND';
} }
$self->{pbot}->{logger}->log("$sql $joiner id NOT IN Seen ORDER BY RANDOM() LIMIT 1\n");
# search for a random unseen quotegrab # search for a random unseen quotegrab
my $sth = $self->{dbh}->prepare("$sql $joiner id NOT IN Seen ORDER BY RANDOM() LIMIT 1"); my $sth = $self->{dbh}->prepare("$sql $joiner id NOT IN Seen ORDER BY RANDOM() LIMIT 1");
$sth->execute(@params); $sth->execute(@params);
@ -162,7 +161,7 @@ sub remove_seen($self, $sql, $params) {
$sql =~ s/^SELECT \*/SELECT id/; $sql =~ s/^SELECT \*/SELECT id/;
my $count = eval { 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); $sth->execute(@$params);
return $sth->rows; return $sth->rows;
}; };

View File

@ -25,7 +25,7 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4644, BUILD_REVISION => 4645,
BUILD_DATE => "2023-04-13", BUILD_DATE => "2023-04-13",
}; };