Posts Tagged ‘input line separator system variable’

Perl – Changing the Input Line Separator and Using the “chomp” Function

Friday, January 6th, 2012

In this blog I demonstrate how you can change the input line separator in Perl and use Perl’s “chomp” function. Note, the input line separator is operating system dependent; see the following prior blog of mine where I discuss this subject in more detail: Unix shell script – convert Mac ASCII file to Unix ASCII file. The “chomp” function checks to see if the last character of a string or list of strings matches the line separator character stored in the ‘$/’ system variable; if there is a match, the character is deleted. (more…)