in reply to Bit operation

1. if usage of $a |= 0x00000008; is right ?
Yes. All you have to do is try it:
use strict; use warnings; my $val = 0xffff_fff0; printf "%x\n", $val; $val |= 0x0000_0008; printf "%x\n", $val; __END__ fffffff0 fffffff8
Side note: don't use $a as a variable name as it has special significance in Perl (sort).
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
    Thanks, On my system its look like
    my $val = 0xffff_fff0; printf "%x\n", $val; $val |= 0x0000_0008; printf "%x\n", $val;
    fffffff0 8
      What version of perl are you using?
      perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread
      Please double check. Are you sure that's exactly the code you ran? If so, please provide the output of perl -V. (That's an uppercase "V".)