From ec70841119a49ebeed4e14ce682f29d15e1ed27d Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 23 Jun 2015 16:08:18 +0200 Subject: [PATCH] keyboard: avoid warning for empty mode parameter Empty string splits to an empty list, resulting in a benign warning: > Odd number of elements in hash assignment --- Shiar_Sheet/Keyboard.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shiar_Sheet/Keyboard.pm b/Shiar_Sheet/Keyboard.pm index 90ec4e8..2b3cc86 100644 --- a/Shiar_Sheet/Keyboard.pm +++ b/Shiar_Sheet/Keyboard.pm @@ -126,7 +126,7 @@ sub print_key { sub print_rows { my $self = shift; my %moderows = ( - -DEFAULT => !@_ ? '' : split(/(?:\s*([^=\s]*)=\s*)/, shift), + -DEFAULT => !!@_ && $_[0] ne '' && split(/(?:\s*([^=\s]*)=\s*)/, shift), # plus specific mode overrides prefixed by '=' ); my $defrows = shift || [2, 1, 0]; -- 2.30.0