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


in reply to Re: How do unpack templates work
in thread How do unpack templates work

Thanks. I do not want hex digits - I just want to split the binary string into two parts. I was using
substr
until I read that unpack is faster and more efficient.

Replies are listed 'Best First'.
Re^3: How do unpack templates work
by jwkrahn (Abbot) on Jul 20, 2012 at 22:51 UTC

    Or you could use a regular expression:

    my ( $uu1, $uu2 ) = $uuid =~ /(\C{4})(\C+)/;