unpack will get the fields directly into the right variables (assuming you can figure out the appropriate pack encoding string .... always takes me ages). But if that weren't available, or in a slightly different situation, you could also make pack return the separator strings:
@fields = split /(\s+)/, $_;
$field[0] will be 17, or 18, or 19,.... $field[1] will be 7 or 19 spaces, depending on whether there is a $llimit field; similarly $field[3] or $field[5] would tell you whether you have a $ulimit field. Obviously too much post-processing in this case, but other cases may not be quite regular enough for unpack.
postscript: Having to go back and replace square brackets with & # 0 9 1 ; and & # 0 9 3 ; should be grounds for justifiable homicide ... all I need now is to figure out who to punish.
dead brain dept: I originally typed unpack in the code line.
--
TTTATCGGTCGTTATATAGATGTTTGCA
In reply to Re: Beginner Question on splitting.
by TomDLux
in thread Beginner Question on splitting.
by BigSmith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |