in reply to unicode? conversion
my $value = ord $byte; my @values = map { ord } split //, $bytes;
or with the "C" template using unpack.
If you wanted the hexadecimal representation of the byte value you could use unpack using the "H" template.my $value = unpack "C", $byte; my @values = unpack "C*", $bytes;
my $hex = unpack "H", $byte; my $hexstring = unpack "H*", $bytes; my @hex = unpack "H2" x length($bytes), $bytes;
update: I might as well add a different way to do that last one (not involving x and therefore probably better):
my @hex = ((unpack "H*", $bytes) =~ /(..)/g);
|
|---|