develooper Front page | perl.perl6.users | Postings from February 2019

print hex?

Thread Next
From:
ToddAndMargo via perl6-users
Date:
February 7, 2019 19:13
Subject:
print hex?
Message ID:
a7a9384a-ab9c-be47-c584-4d56588efc5e@zoho.com
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<AE 5D>
23982

Many thanks,
-T

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About