sub debugf { my $fmt = shift; warn sprintf($fmt, map $_ // '', @_) . "\n"; } debugf "x=%s y=%s", $x, $y; # <-- always using %s!