<?xml version="1.0" encoding="windows-1252"?>
<node id="952520" title="Re: Check for data in array" created="2012-02-08 10:28:34" updated="2012-02-08 10:28:34">
<type id="11">
note</type>
<author id="212789">
thezip</author>
<data>
<field name="doctext">
&lt;br&gt;
&lt;p&gt;If I find that something that "something absolutely *should* work", yet doesn't, I create an override for the data by replacing the normal input with hardcoded values that test all possible conditions.&lt;/p&gt;

&lt;p&gt;For example, just before entering into the "if" statement, hardcode %sections to contain:&lt;/p&gt;

&lt;c&gt;
$sections{'procs'} = 'service.exe';  # Should result in success
#$sections{'procs'} = 'failure.exe';  # Should now result in failure
&lt;/c&gt; 

&lt;p&gt;If the successful hardcode fails, then you have half-split the problem to determine that your logic is incorrect, rather than the data than is being supplied to it. If it works as expected, then your data is the problem.&lt;/p&gt;

&lt;p&gt;Pretty basic stuff, but tricks like this allow you to remove all assumptions about the data you think you are processing.&lt;/p&gt;


&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-212789"&gt;
&lt;br&gt;
&lt;i&gt;What can be asserted without proof can be dismissed without proof. - Christopher Hitchens, 1949-2011&lt;/i&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
952469</field>
<field name="parent_node">
952469</field>
</data>
</node>
