<?xml version="1.0" encoding="windows-1252"?>
<node id="781450" title="Re: What is the best way to compare variables so that different types are non-equal?" created="2009-07-19 11:41:11" updated="2009-07-19 11:41:11">
<type id="11">
note</type>
<author id="708738">
LanX</author>
<data>
<field name="doctext">
eq is supposed to "ignore types" it's just comparing the stringified arguments&lt;P&gt;

[http://perldoc.perl.org/perlop.html#Equality-Operators|eq]: &lt;i&gt;Binary "eq" returns true if the left argument is stringwise equal to the right argument. &lt;/i&gt;&lt;P&gt;

so two arguments mapped to the same string are "equal".&lt;P&gt;

I think you want something like [https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Operators/Comparison_Operators|&lt;c&gt;===&lt;/c&gt; in JS]¹, IMHO you have to construct this on your own.&lt;P&gt;


&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-708738"&gt;
&lt;p&gt;Cheers Rolf
&lt;/div&gt;&lt;/div&gt;&lt;P&gt;

UPDATE: repaired broken link to &lt;c&gt;[doc://eq]&lt;/c&gt;&lt;P&gt;

(¹) an approach with operator overloading can be found here: &lt;br&gt;
[id://781502]</field>
<field name="root_node">
781447</field>
<field name="parent_node">
781447</field>
</data>
</node>
