http://qs1969.pair.com?node_id=982869

unlinker has asked for the wisdom of the Perl Monks concerning the following question:

I am a bit confused about how an unpack template works. For example:

#!/usr/bin/env perl use Modern::Perl; use Data::UUID; my $ug = Data::UUID->new; my $uuid = $ug->create_bin(); say unpack('H*', $uuid); # 767adecd8ed2e11191f4b1907aa0b7e4 my ($uu1, $uu2) = unpack('C4 C*', $uuid); say unpack('H*', $uu1); # Got 313138 Expected:767adecd say unpack('H*', $uu2); # Got 313232 Expected:8ed2e11191f4b1907aa0b7e4

I expected that 'C4 C*' would extract the first four bytes into $uu1 and C* would extract the rest into $uu2. Obviously I am not getting something here. Would appreciate an explanation

Thank you