Yes, this is one of those baked in historical oddities like every mature system has. You know, ones that, when you ask the original designer, the answer always starts with "It made sense at that time..."

Those decisions might come back and bite you. But that doesn't mean the original designers made the wrong choice per se, they might just not have been able to see the whole picture that would result many years after they made their choices.

Think of the Apollo 1 fire. It made sense for NASA to use a pure oxygen atmosphere in their capsules. It saved a lot of weight (weight is everything in rocketry) AND it made the capsules actually safer (no risk of accidentaly putting too much nitrogen in due to a bad sensor, suffocating the astronauts). It made sense to pressurize the capsules on the launch pad to test that they are not leaking away the precious air in space (reducing the risk of a Soyuz 11 catastrophe). It made sense to place Velcro strips all over the spacecraft interior to prevent objects floating around and messing up other systems (after all, in space under the normal, low O2 pressure, Velcro doesn't sustain fire).

What nearly nobody realised were the consequences of the combination of all those factors. In the high, pure oxygen pressure during the plugs out test, Velcro doesn't just burn, it basically explodes. Gus, Ed and Roger paid the price. And yes, Apollo had an inward opening hatch that was presumable safer than the explosive hatch used on Gemini. It was engineered to prevent a repeat of the Gemini accident that nearly killed Gus. It's secured and doesn't open when the capsule is pressurized, just like the doors on modern airliners...

So, defined() sometimes does autovivication and can give you a bad day. But i'm sure the original designers implemented it this way to prevent some problems they encountered at the time.


In reply to Re^3: Defined test creates non-empty hash value by cavac
in thread Defined test creates non-empty hash value by glendeni

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.