<?xml version="1.0" encoding="windows-1252"?>
<node id="765292" title="Re: Why isn't this subroutine working?" created="2009-05-20 13:57:48" updated="2009-05-20 13:57:48">
<type id="11">
note</type>
<author id="263384">
eric256</author>
<data>
<field name="doctext">
&lt;p&gt;&lt;code&gt;elsif&lt;/code&gt; expects to get a condition as well.  so your example should be &lt;/p&gt;
&lt;code&gt;
if (!$Ok) {
  print "x";
} elsif ($some_other &lt;&gt; $condition) {
  print "y";
}
&lt;/code&gt;
&lt;p&gt;Not including the condition does indeed make the elsif into a syntax error, and elsf does indeed make it run, but it doesn't make it work.
&lt;/p&gt;
&lt;p&gt;Oh and please please please don't embed variables in SQL unless you properly untaint them first, and even then only do it if someone is holding a gun to your head ;)
&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-263384"&gt;
&lt;br /&gt;___________&lt;br /&gt;
Eric Hodges
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
765188</field>
<field name="parent_node">
765188</field>
</data>
</node>
