use constant DEBUG => 1; # at the top of the code sub debug { print STDERR @_ if DEBUG; }