more useful options | |
PerlMonks |
Re^3: Extracting Bit Fields (Again)by BrowserUk (Patriarch) |
on Dec 22, 2011 at 08:35 UTC ( [id://944736]=note: print w/replies, xml ) | Need Help?? |
Maybe something like this would work for you? (Update: simplified code): Update 2: Unsimplified code to correct errors noted by oyster2011 below (Thanks!):
Use 'xn' in the template to skip over bits you aren't interested in. You might need to use 'B32' instead of 'b32' depending upon your platform. Masking and shifting is almost certainly quicker, but this could be seen as a nice abstraction. You could also do away with the intermediates if that floats your boat:
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In Section
Seekers of Perl Wisdom
|
|