does raku have a similar function to python’s struct?

There’s the experimental unpack

use experimental :pack;

my $bytearray = "01234567".encode('utf-8');

say $bytearray.unpack("A1 L H"); 

It’s not exactly the same, though; this outputs “(0 875770417 35)”. You can tweak your way through it a bit, maybe.

There’s also an implementation of Perl’s pack / unpack in P5pack

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top