The reason is that when you debug stuff, you can't rely on the fact that code you read is sane or correct.

I don't know why you brought up debugging again. We're discussing code readability. Readable code is code that's aligned with the natural assumptions of the reader. Like you said, you can't rely on those assumptions when debugging, so it's not relevant to this conversation.

Which (when read inaccurately) could either print to a response file handle, or print a response.

You'd never see print $response $/; alone. One only writes a line ending to a handle if one just wrote to the handle or if you're about to write to the handle. Out of context, this looks pretty ambiguous, but there's no way I'd get it wrong in context.

Prints to file handles tend to occur in series and usually right after an open. The pattern is highly visible, and tends be noticed instantly.

The arguments for mandating curlies sound reasonable, but in practice, even with all the bad code I debug on PerlMonks, I don't believe curlies would ever have helped me. Quite the opposite, they distract me when I do see them because almost noone uses them.

For foreign code I have no influence on the naming

You can't add curlies to foreign code either, so that's not relevant.


In reply to Re^7: curly braces around a lexical file handle by ikegami
in thread curly braces around a lexical file handle by rastoboy

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.