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 CodeC# code$mPolyTable[(unpack "V", pack "U4", ($mCrc ^ $byte))] ;
Any help would be greatly appreciated.mCrc = mPolyTable[(byte)(mCrc ^ iByteArray[x])];
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: pack and unpack trouble
by ikegami (Patriarch) on Dec 22, 2011 at 16:28 UTC | |
by scoobyrico (Beadle) on Dec 22, 2011 at 18:30 UTC | |
by Util (Priest) on Dec 22, 2011 at 19:00 UTC | |
by ikegami (Patriarch) on Dec 22, 2011 at 20:23 UTC | |
by scoobyrico (Beadle) on Dec 23, 2011 at 13:22 UTC |
Back to
Seekers of Perl Wisdom