in reply to using warn instead or print STDERR?
Then you can implement dprint as e.g.dprint 1, "this is debugging"
sub dprint { my $level = shift; return unless $DEBUG >= $level; my ($file, $line) = (caller)[1,2]; print STDERR "$file:$line: @_\n"; }
|
|---|