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':
And what I see is: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"; }
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |