<?xml version="1.0" encoding="windows-1252"?>
<node id="435357" title="Re: Perl oddities" created="2005-03-01 06:03:21" updated="2005-07-27 10:22:56">
<type id="11">
note</type>
<author id="157432">
Joost</author>
<data>
<field name="doctext">
I think the filehandle functions are generally messy: Bareword file handles, indirect object syntax for print() and close(), open() modifies it's $fh argument, and my least favorite "feature": defaulting to ignoring errors, which just means you end up having to type &lt;code&gt;open FH,"&lt;","file" or die "Can't open file: $!";&lt;/code&gt; every time you use open, print and close.
&lt;p&gt;
I would prefer something like this:
&lt;p&gt;
&lt;code&gt;
my $fh = open "&lt;","filename";
$fh-&gt;print "stuff";
$fh-&gt;close;
&lt;/code&gt;
&lt;p&gt;
Which would also make it easier to replace a filehandle with some other object.
&lt;p&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-157432"&gt;
&lt;em&gt;[id://149675|"What should it profit a man, if he should win a flame war, yet lose his cool?"]&lt;/em&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
435338</field>
<field name="parent_node">
435338</field>
</data>
</node>
