in reply to How do I use the switch -l?

See perlrun (or perldoc perlrun) - This switch can be used to modify the input and output line separators, $/ and $\ respectively. The main use for this type of assignment is in the command line for one-liner scripts used for file processing.

An example modified from perlrun, to trim lines in *.txt files to a maximum width of 80 characters ...

perl -lpe 'substr($_, (length $_ > 79) ? 80 : length $_) = ""' *.txt

This code will step through the file, delete all characters beyond the 80 character length of the string and then write the file back out, retaining the original line separator.

 

Update : Corrected code example to handle lines less than 80 characters in length - Thanks ariels++