'defined' would be the keyword you are looking for....<br><br>if (defined $product) ...<br>if (defined $ARGV[0]) ...<br><br><div><span class="gmail_quote">On 10/17/06, <b class="gmail_sendername">CaptNemo</b> &lt;<a href="mailto:CaptNemo@austin.rr.com">
CaptNemo@austin.rr.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Why is it so hard to check for null values in perl!?!?!
<br><br><br>Two situations:<br><br><br>1) checking is a variable is empty:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($product eq &quot;&quot;)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($product &lt;&gt; &quot;&quot;)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($product ne &quot;&quot;)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($product != &quot;&quot;)...
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($product eq NULL)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($product &lt;&gt; NULL)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($product ne NULL)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($product != NULL)...<br><br><br>2) checking to see if command line args were present:<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($ARGV[0] eq &quot;&quot;)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($ARGV[0] &lt;&gt; &quot;&quot;)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($ARGV[0] ne &quot;&quot;)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($ARGV[0] != &quot;&quot;)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($ARGV[0] eq NULL)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($ARGV[0] &lt;&gt; NULL)...
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($ARGV[0] ne NULL)...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IF ($ARGV[0] != NULL)...<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...none seem to work.&nbsp;&nbsp;HOW do you check for NULL values!?!?<br><br>_______________________________________________<br>Austin mailing list
<br><a href="mailto:Austin@pm.org">Austin@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/austin">http://mail.pm.org/mailman/listinfo/austin</a><br></blockquote></div><br><br clear="all"><br>-- <br>Pat Ludwig &lt;
<a href="mailto:havoc@boldo.com">havoc@boldo.com</a>&gt;<br>AIM: HaVoCPaT<br><br>&quot;Whoever fights monsters should see to it that in the process he does not become a monster. And when you look long into an abyss, the abyss also looks into you.&quot;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Friedrich Nietzsche, Beyond Good and Evil 89 (Walter Kaufmann trans., Vintage Books 1966) (1886).