1. if usage of $a |= 0x00000008; is right ?Yes. All you have to do is try it:
Side note: don't use $a as a variable name as it has special significance in Perl (sort).use strict; use warnings; my $val = 0xffff_fff0; printf "%x\n", $val; $val |= 0x0000_0008; printf "%x\n", $val; __END__ fffffff0 fffffff8
2. how extract hex value by Regular Expression from string I have : For example:
You can use the [[:xdigit:]] character class to extract hex values. See perlre.
In reply to Re: Bit operation
by toolic
in thread Bit operation
by toren
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |