unixhome has asked for the wisdom of the Perl Monks concerning the following question:
my $highnibble = ((ord $byte[0]) >> 4)); The variable $highnibble prints the right value.
What am I doing wrong? Thanks, RVmy $lownibble = (((unpack ("H", $byte[0]) << 4) >> 4)); The variable $lownibble prints the wrong value (value of $highnibble).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Store high/low nibble into variables
by japhy (Canon) on Jun 16, 2006 at 15:39 UTC | |
|
Re: Store high/low nibble into variables
by sgifford (Prior) on Jun 16, 2006 at 15:36 UTC | |
|
Re: Store high/low nibble into variables
by unixhome (Novice) on Jun 16, 2006 at 16:06 UTC |