<?xml version="1.0" encoding="windows-1252"?>
<node id="1004005" title="Re: Having to remove \r from $ARGV[-1]" created="2012-11-15 07:48:51" updated="2012-11-15 07:48:51">
<type id="11">
note</type>
<author id="190859">
bart</author>
<data>
<field name="doctext">
You can add a space at the end of the line, that'll probably take care of it. Unless your editor is set to drop trailing spaces... 

&lt;p&gt;More reliable is to use " --" to tell GetOptions that there are no more options. In that case, the trailing CR will &lt;em&gt;probably&lt;/em&gt; be ignored.

&lt;p&gt;Note that in a more recent perl (= less than a few years old), CR inside source code is automatically handled, because in older perls, it did choke on it (e.g. when running a Windows text script on Linux). But not for the shebang line (and I honestly don't know what happens now, with multiline strings).

&lt;p&gt;Of course if you had a bit of discipline and set the line endings to Unix in your text editor, you wouldn't have this problem. Most decent text editors allow you to chose a default line ending for new file, or, I would hope so.</field>
<field name="root_node">
1004004</field>
<field name="parent_node">
1004004</field>
</data>
</node>
