<?xml version="1.0" encoding="windows-1252"?>
<node id="324846" title="Re: Uncommon* but Useful Perl Command Line Options (for one-liners)" created="2004-01-28 19:49:16" updated="2005-02-24 08:28:13">
<type id="11">
note</type>
<author id="299049">
ysth</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;'-l' has a dual nature - on input it behaves like chomp(), automatically removing newline characters, while on output, as we've seen, it becomes the anti-chomp, adding newlines. 

&lt;/i&gt;&lt;/blockquote&gt;

This needs more explication.  -l's effect on input and output are not as parallel as this would imply.
&lt;p&gt;
-l's effect on input &lt;em&gt;only&lt;/em&gt; applies to the LINE loop generated by -n or -p (by adding a chomp at the beginning).  If -n and -p aren't specified, no input is changed.
&lt;p&gt;
-l's effect on output applies to all print (but not printf) statements, however situate (by virtue of setting $\).
&lt;p&gt;Update: said $/ meant $\.</field>
<field name="root_node">
324749</field>
<field name="parent_node">
324749</field>
</data>
</node>
