my $_debug = 1; open(BUG,">>/home/path/to/file") if $_debug; seek(BUG, 0, 2) if $_debug; print BUG qq~Started debugging at line: ~ . __LINE__ . "\n" if $_debug; if($_debug) { foreach my $key (keys (%_billingInfo)) { print BUG escapeHTML ($key) . " = " . escapeHTML ($_billingInfo{$key}) . "\n"; } }