in reply to use warnings and debug messages

I have used something similar to the following function in the past:
sub debug { warn join '', map $_ // '<undef>', @_, "\n"; } # and then... debug "x=", $x, " y=", $y;

Update: and sometimes also a -f variant:

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