in reply to split string by character count

As noted above, pack and unpack are perl's built-in methods of doing this kind of thing. However, I never can remember how the syntax works for the templates required by those two functions. I've used Parse::FixedLength some and have found it very handy for splitting out fixed width text files. Here's an example of how to use it (not sure on the exact format of the data in @list or what you need after processing each line):
@input = <FH> # not sure where the input is from @list = () # whatever... foreach my $line(@input){ my $parser = new Parse::FixedLength([ map {m/^\d+: (.+) (\d+)/} @list ]); my $hash = $parser->parse($line); # do whatever with $has }
Just another option to using pack/unpack manually...