In addition to using hex instead of pack,
you need to change
if($value && $MSG_FLAG_READ) {
into
if($value & $MSG_FLAG_READ) {
In reply to Re: Using pack to evaluate text strings as hexadecimal values
by ikegami
in thread Using pack to evaluate text strings as hexadecimal values
by davis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |