sub debuglogger { my $msg = shift; if ($DEBUG) { print STDERR "$msg\n"; } }