Why wouldn't unpack work? unpack doesn't need "terminations". Is the string an exact count of 6 char strings?
I can't give you an exact example cause I don't know if your string is unsigned, signed, unicode, etc. but look at the
the templates for pack and unpack and you should be able to grab all of the pieces at once. This sounds like a trivial use of unpack.
I am wondering what you are really asking - "the strings I'm after" implies you just don't want every six chars...
are you looking for something specific? If so you should be looking at a regular expression pulling that out perhaps.
This sounds like a one liner based on your description so I am wondering if I am not understanding...
Mark K.
On Dec 29, 2003, at 12:10 AM, Kim Helliwell wrote:
I have a long string of characters (> 40,000 chars) that I need to break up into strings of 6 chars each. Is there a simple way to do this in Perl? unpack() doesn't seem to be the right solution; there are no terminations for the strings I'm after.
Have I actually found something that is easier in C than in Perl?
Kim Helliwell [EMAIL PROTECTED] Homepage: http://homepage.mac.com/kimgh
