http://www.perlmonks.org?node_id=841422


in reply to Rearrange hex digits.

my $uuid = sprintf('%08X-%04X-%04X-%04X-%04X%08X', unpack 'V v v n nN', pack 'H*', $_);

Not that unreadable (relatively speaking). With 'n' and 'v', the size of the letter (lc vs uc) indicates the size of the field (16 vs 32 bit). 'n' keep order, 'v' reverses it.