<?xml version="1.0" encoding="windows-1252"?>
<node id="715067" title="Re: Bitwise Operator Error" created="2008-10-02 14:49:57" updated="2008-10-02 14:49:57">
<type id="11">
note</type>
<author id="698926">
broomduster</author>
<data>
<field name="doctext">
Your hexadecimal number in &lt;c&gt;$testString&lt;/c&gt; needs to &lt;strike&gt;begin with &lt;c&gt;0x&lt;/c&gt;&lt;/strike&gt; be properly interpreted as hexadecimal.  Then it will work.  You can also simplify your white-space removal.  All together, here is one way to get where you want to go:
&lt;c&gt;
$testString =~ s/\s+//g;&lt;/c&gt;
&lt;strike&gt;&lt;c&gt;$testString =~ s/^/0x/;
$maskResult = $testString &amp; 400000000000000000000000;&lt;/c&gt;&lt;/strike&gt;
&lt;c&gt;$maskResult = hex( $testString ) &amp; 0x400000000000000000000000;&lt;/c&gt;
&lt;p&gt;&lt;b&gt;Updated:&lt;/b&gt; Need to use &lt;c&gt;hex&lt;/c&gt; and need to have mask as hex string.
&lt;p&gt;&lt;b&gt;Updated 2:&lt;/b&gt; I see [ikegami] has also pointed out my error(s) corrected above.
&lt;p&gt;&lt;b&gt;Updated 3:&lt;/b&gt; and [ikegami] has also noted the need for Math::BigInt here.
</field>
<field name="root_node">
715064</field>
<field name="parent_node">
715064</field>
</data>
</node>
