in reply to Bit operation
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Bit operation
by toren (Novice) on Jan 12, 2011 at 15:13 UTC | |
by toolic (Bishop) on Jan 12, 2011 at 15:31 UTC | |
by ikegami (Patriarch) on Jan 12, 2011 at 18:23 UTC |