Cleanup: use subroutine signatures, remove deprecated methods.

The signatures feature has been "experimental" since Perl 5.20 (May 2014), but
expected to stay. After 8 years I'm ready to take the risk :)

Have added Perl v5.28 (June 2018) as the minimum requirement, even though the
current revbank should work with 5.20, to see if this bothers any users. Perl
v5.28 is in Debian "buster", which is now oldstable.
This commit is contained in:
Juerd Waalboer 2021-12-03 18:00:34 +01:00
parent 1661661ffd
commit eed0db7897
45 changed files with 233 additions and 444 deletions

View file

@ -5,7 +5,7 @@
use Time::HiRes qw(sleep);
sub _read_warnings {
sub _read_warnings() {
open my $fh, 'revbank.warnings' or die $!;
return map {
my ($regex, $products, $text) = m[^
@ -29,8 +29,7 @@ sub _read_warnings {
} grep /\S/, grep !/^\s*#/, readline $fh;
}
sub hook_add_entry {
my ($class, $cart, $entry) = @_;
sub hook_add_entry($class, $cart, $entry, @) {
return if not $entry->has_attribute('product_id'); # skip unlisted, deposit, give, take
my @warnings = map {