Try:
my( $bit1, $bit2 ) = unpack 'a4 a*', $uuid;
But, regarding your "more efficient than substr" remarks. For the sake of a single operation like this, you won't notice the difference; even if there actually is any.
In reply to Re: How do unpack templates work
by BrowserUk
in thread How do unpack templates work
by unlinker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |