<?xml version="1.0" encoding="windows-1252"?>
<node id="781456" title="Re: What is the best way to compare variables so that different types are non-equal?" created="2009-07-19 12:05:45" updated="2009-07-19 12:05:45">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;
qr/STRING/msixpo 

&lt;p&gt;This operator quotes (and possibly compiles) its STRING as a regular expression. STRING is interpolated the same way as PATTERN in m/PATTERN/. If "'" is used as the delimiter, no interpolation is done. Returns a Perl value which may be used instead of the corresponding /STRING/msixpo expression. The returned value is a normalized version of the original pattern. &lt;b&gt;It magically differs from a string containing the same characters: ref(qr/x/) returns "Regexp",&lt;/b&gt; even though dereferencing the result returns undef.
&lt;/i&gt;&lt;/blockquote&gt;

&lt;p&gt;I think the relevant part of the docs is the bit I've highlighted. &lt;c&gt;qr//&lt;/c&gt; &lt;strike&gt;compiles&lt;/strike&gt; &lt;i&gt;normalises&lt;/i&gt; the regex--which basically means [blessing] it. Hence the magical behaviour.


&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.&lt;/div&gt;
&lt;div&gt;[http://www.theregister.co.uk/2009/06/11/pcw/|RIP PCW]&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
781447</field>
<field name="parent_node">
781447</field>
</data>
</node>
