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

While other forms can be far worse, AND eror-prone, I'm not sure this qualifies as a shining example of readable and maintainable.

I haven't used unpack very much outside dismantling dates, but I found it worth the inconvenience of learning the basic use of the function, because it is so so simple and clear, other than the horrific confusion of what all the codes signify, and which one means what. Luckily, named variables can conceal the format string.

my ( $year, $month, $day ) = unpack $YYYYMMDD_format, $date_string;
TomDLux

--
TTTATCGGTCGTTATATAGATGTTTGCA