in reply to Re^3: help needed in storing the return values of unpack
in thread help needed in storing the return values of unpack

hai Corion,
Your answer will not work. since U20 will return 20 elements,so the first element will be stored in $first , and remaining 19 elements and the strings returned by A10A10A10 will be stored in the array @second.
  • Comment on Re^4: help needed in storing the return values of unpack

Replies are listed 'Best First'.
Re^5: help needed in storing the return values of unpack
by Corion (Patriarch) on Mar 23, 2006 at 09:49 UTC

    Ooops - I thought that U returned a Unicode string and not single items, so my answer is wrong. You should go with GrandFather's approach and move the 20 items out of the array later:

    my @items = unpack "...", $string; my @first = splice @items, 0, 20;