note
broomduster
Your hexadecimal number in <c>$testString</c> needs to <strike>begin with <c>0x</c></strike> 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:
<c>
$testString =~ s/\s+//g;</c>
<strike><c>$testString =~ s/^/0x/;
$maskResult = $testString & 400000000000000000000000;</c></strike>
<c>$maskResult = hex( $testString ) & 0x400000000000000000000000;</c>
<p><b>Updated:</b> Need to use <c>hex</c> and need to have mask as hex string.
<p><b>Updated 2:</b> I see [ikegami] has also pointed out my error(s) corrected above.
<p><b>Updated 3:</b> and [ikegami] has also noted the need for Math::BigInt here.
715064
715064