3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-05 19:49:32 +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):
# cpanm -n --installdeps . --with-all-features --without-feature compiler_vm_win32
requires 'perl' => '5.010001';
requires 'perl' => '5.020000';
# PBot core
requires 'Cache::FileCache';

View File

@ -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 {

View File

@ -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;
};

View File

@ -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",
};