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

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; };

Replies are listed 'Best First'.
Re^3: how do you check if it's compiled away?
by bart (Canon) on Aug 17, 2007 at 06:58 UTC
    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 =>