Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Hi Ovid

    All you're doing is adding obfuscation to %ENV.

    Big mistake.

    • Diagnosing $ENV{FEILD} is better? What's your solution?

      • Hash::Util's lock_keys seems like a good solution to me.

        • Except that sometimes people need to add environment variables. Boom!

          • There is also an unlock_keys function for that case. And then if you're paranoid, you re-lock it. And if you want to use PAR later, you can have lock_keys be done conditionally depending on whether you are in your development environment or are all packaged up with PAR.

            My experience is that using lock_keys to cause typos in hash accesses to blow up has a similar effect on catching my typos to strict. Albeit with a performance overhead. And the bonus is that it works for any kind of hash.

            An example where I use this is that in certain kinds of data processing it is nice to set up an array of anonymous hashes with locked keys. Then any typos in your hash accesses are caught right away with no debugging needed. And if you need to for performance reasons, you can easily remove the lock_keys call once the code is developed.