in reply to how do you check if it's compiled away?
in thread removing debugging code at compile time ?

with the minor gotcha that 'Apple::Peeler' becomes 'APLE_PELER_DEBUG'.


DWIM is Perl's answer to Gödel
  • Comment on Re: how do you check if it's compiled away?

Replies are listed 'Best First'.
Re^2: how do you check if it's compiled away?
by Anonymous Monk on Aug 17, 2007 at 04:34 UTC
    darn, i forgot about that. i had originally had a `uc` i was trying to optimize away. so the working version is:
    use constant DEBUG => do { (my $p = uc __PACKAGE__ ) =~ tr/:/_/s; $ENV{ $p . '_DEBUG' } || 0; };
      And all for nothing, because I believe in most (I dare not say "all") systems, environment variables (and %ENV) are case insensitive.

      Well, it definitely doesn't hurt.

        POSIX requires that environment variable names be case sensitive.
        Environment vars are definately case sensitive on Debian, and there's no special treatment of %ENV by perl:

        print "uc => ", $ENV{EDITOR} || '', "\n"; print "lc => ", $ENV{editor} || '', "\n"; __END__ UC => emacs lc =>