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

@ -1,5 +1,10 @@
package RevBank::Global;
use strict;
use v5.28;
use warnings;
use feature qw(signatures);
no warnings qw(experimental::signatures);
use POSIX qw(strftime);
use RevBank::Amount;
@ -14,8 +19,7 @@ sub import {
*{"$caller\::NEXT"} = sub () { \4 };
*{"$caller\::DONE"} = sub () { \5 };
*{"$caller\::parse_user"} = \&RevBank::Users::parse_user;
*{"$caller\::parse_amount"} = sub {
my ($amount) = @_;
*{"$caller\::parse_amount"} = sub ($amount) {
defined $amount or return undef;
length $amount or return undef;
@ -32,7 +36,7 @@ sub import {
*{"$caller\::say"} = sub {
print @_, "\n";
};
*{"$caller\::now"} = sub {
*{"$caller\::now"} = sub () {
return strftime '%Y-%m-%d_%H:%M:%S', localtime;
};