in reply to use warnings and debug messages
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!
|
|---|