http://qs1969.pair.com?node_id=944804

scoobyrico has asked for the wisdom of the Perl Monks concerning the following question:

I have been tasked to convert some C# code to Perl. I think I need pack and unpack and I am having some trouble understanding them well enough. I have read the tutorial and have worked though some of the examples, but still I am unable to get the right results.

The are where I have not been able to get right is with the byte casting of the result of the ^ operand. When I print out $mRc ^ $byte I get 4294965887 which I need to be 127.

Perl Code
$mPolyTable[(unpack "V", pack "U4", ($mCrc ^ $byte))] ;
C# code
mCrc = mPolyTable[(byte)(mCrc ^ iByteArray[x])];
Any help would be greatly appreciated.