my $debug = 0; if($debug && $debug == 1) { OPEN(DEBUG,">>/home/path/logs/debug.txt") or die "Could not Open File for appending: $!"; }