On 6/19/22 00:33, ToddAndMargo via perl6-users wrote:
Hi All,
I have a string:
> my Str $x = "1BB67AE85A";
1BB67AE85A
which has the hexadecimal values I want to
add to a buffer:
> my buf8 $y = buf8.new($x.base(16));
No such method 'base' for invocant of type 'Str'. Did you mean any of
these: 'Bag', 'Date', 'Hash', 'are', 'asec', 'hash', 'take'?
in block <unit> at <unknown file> line 1
In other words, I want to set $y to
0x1B 0xB6 0x7A 0xE8 0x5A
How do I do this?
Many thanks,
-T
Won't let me push an integer on a buffer either:
> my buf8 $y;
> $a
-68
> $y.push($a.Buf)
No such method 'Buf' for invocant of type 'Int'
in block <unit> at <unknown file> line 1
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~