Thanks for the responses - and I did do extensive searching (i.e. that's what I found when searching - that perl should never see the CR). However, I'm seeing something different (running as "perl cmds.pl" in a Command Prompt on Windows 10)

File 'cmds.pl':

open my $makefileToProcess, "<", "input_file.txt" or die "input_file.t +xt: $!"; while (my $line = <$makefileToProcess>) { print "LINE BEFORE:$line:\n"; chomp $line; print "LINE AFTER:$line:\n"; }
And what I see is:
LINE BEFORE:xyzCRLF: LINE AFTER:xyzCR:

(NOTE that CRLF is the CRLF pair, not actual 'C''R'L'F'. Same with CR.)

What's even more interesting is if, instead of running as "perl cmds.pl", I use the Windows ".pl" association, and run simply as "perl_cmds.pl", it works as you described (i.e. the CR is never seen).

In this case, I have 2 different perl implementations installed, one being cygwin (perl version 5.26, which is the one that keeps the CR) and the other being a standalone perl (perl v5.8.8, which is the one that eliminates the CR).

This is why I originally asked how the default IRS gets set, but perhaps the real question is why one perl on a Windows system is allowing the CR to pass through to the perl script.


In reply to Re: How is the default "Input Record Separator" set? by brettasterling
in thread How is the default "Input Record Separator" set? by brettasterling

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.