in reply to Re: Splitting up a string by lengths
in thread Splitting up a string by lengths

^^^ Nice!! I never would've thought of that. I'll be using that a lot in the future.

Update: This is turning into a nice TIMTOWTDI thread!

Replies are listed 'Best First'.
Re^3: Splitting up a string by lengths
by thor (Priest) on Jul 26, 2005 at 03:24 UTC
    in reasonably recent perls, you can do stuff like this:
    my @cc = unpack("(A4)4", "1234567890123456");
    instead of the more verbose
    my @cc = unpack("A4A4A4A4", "1234567890123456");
    I've used it in the past with great success. Besides...it might improve your golf game. :)

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      Good additional info, thanks!