I think "normal use" is the point. What is normal to me is that output from somewhere else i am reading in always has "\n" so I can use chop - it is simply unheard of in a unix environment for programs to accidentally forget a "\n" unless something is very wrong. So if the last line doesn't have a "\n" - I actually need the program to break somewhere rather than hide the fault and functionally is as good as anywhere - at least it'll get picked up. chop has the advantage of not hiding the problem (it chops something off at least and if that's functionally incorrect it'll show up during testing) in habitual use whereas with chomp you would need to add an "or die" - that's more dangerous because it's easy to forget. It may not matter in your working environment but it sure matters in the last two industries I worked in - mobile telephone billing and market data - you just do NOT want to be hiding unterminated files in any of my working environments going back the last ten years. Before that I used C so the problem didn't arise.
__________________________________________________________________________________

^M Free your mind!


In reply to Re^4: chop vs chomp by Moron
in thread chop vs chomp by Moron

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.