From 76ef79b9eee582dbc68f381786452cffbe4609d9 Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Sun, 12 Jun 2022 02:31:29 +0200 Subject: [PATCH] Suppress warning when -cash does not yet exist --- lib/RevBank/Amount.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/RevBank/Amount.pm b/lib/RevBank/Amount.pm index 4aa42c7..cc2b10e 100644 --- a/lib/RevBank/Amount.pm +++ b/lib/RevBank/Amount.pm @@ -75,7 +75,7 @@ sub new_from_float($class, $num) { } sub parse_string($class, $str) { - $str =~ /\S/ or return undef; + defined $str and $str =~ /\S/ or return undef; my ($neg, $int, $cents) = $str =~ /^\s*(?:\+|(-)?)([0-9]+)?(?:[,.]([0-9]{1,2}))?\s*$/