diff --git a/CHANGES b/CHANGES index 2e59a49..149f248 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ + - warn if trm() is called with undefined arguments + 0.49.6 2024-07-17 17:25:39 +0200 Tobias Oetiker - fix some more memory loops diff --git a/lib/CallBackery/Translate.pm b/lib/CallBackery/Translate.pm index 3f84aa9..31b7913 100644 --- a/lib/CallBackery/Translate.pm +++ b/lib/CallBackery/Translate.pm @@ -130,8 +130,14 @@ use overload }; sub trm ($str,@args) { - # make sure the arguments are stringified - return bless [$str,map { "$_" } @args]; + # make sure the arguments are stringified, warn if undefined + return bless [$str,map { + if (not defined $_) { + my ($package, $filename, $line) = caller; + warn "Undefined argument for str='$str' from $package line $line"; + } + "$_" + } @args]; } =head2 $str->TO_JSON