in reply to Re^3: Using the Perl Debugger (-d)
in thread Using the Perl Debugger (-d)
{ my $debug; BEGIN { if(grep { $_ eq '-d' } @ARGV) { # look for switch $debug = 1; @ARGV = grep { $_ ne '-d' } @ARGV; # remove switch } } use constant DEBUG => $debug; } print "Debug is on" if DEBUG;
Does anybody else get a "Useless use of a constant in void context" warning for the print line if DEBUG is off, or is it my old Perl version (5.6.1)? -MO=Deparse tells me it got replaced by the statement '???';, which might explain it. It's still silly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Using the Perl Debugger (-d)
by BrowserUk (Patriarch) on Jan 26, 2007 at 12:09 UTC |