my $DEBUG = 1; #... later in your code if ($DEBUG) { warn "Something happened\n" }