Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: unpack into arrayrefs?

by Fletch (Bishop)
on Feb 22, 2022 at 16:23 UTC ( [id://11141550]=note: print w/replies, xml ) Need Help??


in reply to unpack into arrayrefs?

Perhaps List::MoreUtils natatime?

use 5.034; use List::MoreUtils qw( natatime ); use YAML::XS qw( Dump ); my $data = pack("H*", "0000230ebb0000002b0ece000000330ee200"); my @vals = unpack("(CCSS)*", $data); my $it = natatime 4, @vals; my @grouped; while( my @cur = $it->() ) { push @grouped, [ @cur ]; } say Dump( \@grouped ); __END__ $ perl fooble.plx --- - - 0 - 0 - 3619 - 187 - - 0 - 0 - 3627 - 206 - - 0 - 0 - 3635 - 226

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141550]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found