use 5.010; use strict; use warnings; use constant DEBUG => 1; no if DEBUG, warnings => 'uninitialized'; my $x = 23; my $y; say "With DEBUG = ", DEBUG; debug("x='$x' y='$y'") if DEBUG; if (DEBUG) { sub debug { say shift; } } #### 22:41 >perl 1758_SoPW.pl With DEBUG = 0 22:41 >perl 1758_SoPW.pl With DEBUG = 1 x='23' y='' 22:41 >