<?xml version="1.0" encoding="windows-1252"?>
<node id="488838" title="Re^2: Perl Best Practices book: is this one a best practice or a dodgy practice?" created="2005-09-02 23:03:55" updated="2005-09-02 19:03:55">
<type id="11">
note</type>
<author id="107600">
TheDamian</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
 I'm not even sure what the advantage might be to using the same filename for input and output.
&lt;/i&gt;&lt;/blockquote&gt;

I certainly don't suggest (either here or in the book) that you &lt;em&gt;should&lt;/em&gt; use the same file for input and output. I merely observe that, if you allow people to independently specify input and output filenames on the command-line, some of them inevitably &lt;em&gt;will&lt;/em&gt; use the same name for both files (either intentionally or accidentally). So you have to be aware of the possibility and cope with it somehow.

&lt;p&gt;In the book, I suggest two solutions, one of which is more efficient but apparently fails on certain obscure operating systems (and, yes, I will definitely update the book to reflect that limitation, as soon as I can).</field>
<field name="root_node">
488824</field>
<field name="parent_node">
488836</field>
</data>
</node>
