Re: split and nils?

2019-02-07 Thread Brad Gilbert
First off a Str is a singular value, not a list. Which is a good thing. my $a = "abc"; my $b = "\c[COMBINING ACUTE ACCENT]"; say $a.chars; # 3 say $b.chars; # 1 If they were a list, then combining them should create something that is 4 chars long, but it doesn't. say ($a ~

print hex?

2019-02-07 Thread ToddAndMargo via perl6-users
Hi All, What is the easiest way to get both print and say to print $i below in Hex? $ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int16 $i=0x5DAE; say $x; say $i;' Buf:0x 23982 Many thanks, -T

Re: print hex?

2019-02-07 Thread Curt Tilmes
On Thu, Feb 7, 2019 at 2:14 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > What is the easiest way to get both print and say to print $i below in Hex? > > $ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int16 $i=0x5DAE; say $x; say $i;' > > Buf:0x > 23982 say $i.base(16)

Re: print hex?

2019-02-07 Thread Todd Chester via perl6-users
On 2/7/19 11:22 AM, Curt Tilmes wrote: On Thu, Feb 7, 2019 at 2:14 PM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: What is the easiest way to get both print and say to print $i below in Hex? $ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int16 $i=0x5DAE; say $x;

Re: shift left syntax?

2019-02-07 Thread yary
perl6 -e 'my $i = 0x5DAE; $i +<= 1; say $i.base(0x10);' BB5C -y >

buf to integer?

2019-02-07 Thread Todd Chester via perl6-users
Hi All, I am dealing with a Buf what includes 32 bit integers, but they are entered somewhat backwards as view with hexedit: AE 5D 5C 72 represents the number 725C5DAE This is what I have come up with to convert this type of number in a buffer to and integer $ p6 'my Buf

Re: shift left syntax?

2019-02-07 Thread Todd Chester via perl6-users
On 2/7/19 10:36 PM, yary wrote: perl6 -e 'my $i = 0x5DAE; $i +<= 1; say $i.base(0x10);' BB5C -y Hi Yary, $ p6 'my Buf $x=Buf.new(0xAE,0x5D); my int32 $i=0x5DAE; say $x; say $i.base(0x10); $i +< 0x01; say $i.base(0x10);' WARNINGS for -e: Useless use of "+<" in expression "$i

shift left syntax?

2019-02-07 Thread Todd Chester via perl6-users
Hi All, Is this the only way to shift left? $i = $i +< 0x01 $ p6 'my int32 $i=0x5DAE; say $i.base(0x10); $i = $i +< 0x01; say $i.base(0x10);' 5DAE BB5C Does we have any of those fancy += ~= ways of doing it? Many thanks, -T