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

@ -4,14 +4,11 @@ use List::Util ();
HELP "split <account>..." => "Split the bill with others";
sub _select_split {
my ($cart) = @_;
sub _select_split($cart) {
grep $_->{amount} < 0, $cart->entries
}
sub command :Tab(take,steal,split) {
my ($self, $cart, $command) = @_;
sub command :Tab(take,steal,split) ($self, $cart, $command, @) {
$command eq 'split' or return NEXT;
$self->{users} = [];
@ -25,9 +22,7 @@ sub command :Tab(take,steal,split) {
return "User to take from (not yourself)", \&arg;
}
sub arg :Tab(USERS) {
my ($self, $cart, $arg) = @_;
sub arg :Tab(USERS) ($self, $cart, $arg, @) {
my $users = $self->{users};
if (@$users and $arg eq $self->{split_finish}) {