Why must he ask that? Because it looks wrong. And is not accompanied by a comment warning that, though it looks wrong, it is intended.

Why does it look wrong? How does it look wrong?

Since you ask that question, I assume you haven't any experience maintaining large legacy code bases, with minimal test coverage, where the original authors have long since left the company.

Ugh, don't take this the wrong way, but that sounds like pure sundialsvc4ism

If code is that bad, how can you trust when they wrote  $_ //= '' for values %number_of_immortal_perl_monks they really meant to write that? After all it has no comment explaining even though it looks correct, we didn't make a mistake, we understood it for real to be correct, for really real this time

How can I learn when code "looks wrong"? I want to learn from you , can you teach me?

All three are equally clear at a glance (I glanced at them, equally clear, no headache)
Yet you did not notice the difference between "immoral" and "immortal"?

I did notice it, your first example was also a typo, and like I already said, perl will notice, perl is very good at catching typos


In reply to Re^8: Convert undef to empty string in a hash by Anonymous Monk
in thread Convert undef to empty string in a hash by ibm1620

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.