<?xml version="1.0" encoding="windows-1252"?>
<node id="1013357" title="Re: Seeking guidance for more idiomatic way of (re)writing this script." created="2013-01-15 06:03:29" updated="2013-01-15 06:03:29">
<type id="11">
note</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;code&gt;
if (open ...) {
  print error
} else {
  real code here
}
#EOF
&lt;/code&gt;

&lt;p&gt;is better written as&lt;/p&gt;
&lt;code&gt;
if (open ...) {
  print error
  exit(1);
}

real code here
&lt;/code&gt;

&lt;p&gt;Besides that, you might want to try splitting the script's processing stages into well-named subroutines. It will help you reduce the amount of variables in the current scope, too. And perhaps rid of the temporary file -- I'm sure MIME::Lite can attach a "file" from a string variable.&lt;/p&gt;</field>
<field name="root_node">
1013260</field>
<field name="parent_node">
1013260</field>
<field name="reputation">
5</field>
</data>
</node>
