|Syntactic Confectionery Delight|
Bit operationby toren (Novice)
|on Jan 12, 2011 at 14:00 UTC||Need Help??|
toren has asked for the
wisdom of the Perl Monks concerning the following question:
I have an attribute (32 bits-long), that each bit responsible to specific functionality. Perl script I'm writing should turn on 4th bit, but save previous definitions of other bits.I use in my program:
** MyGetFunc/ MySetFunc my own fuctions that know read/fix value.Questions:
1. if usage of $a |= 0x00000008; is right ?
2. how extract hex value by Regular Expression from string I have : For example:
"Attribute: Somestring: value (8 long (0x8))"
Thanks in advance