On Sat, Jan 04, 2003 at 05:06:44AM -0500, Mark Goland wrote: > hi , I am having a hard time matching n bits at a time. basicly I have a > string which can be X bytes long, I want to creat an array of N bytes long. > So lets say X=23 and N=5, I would have an array of 5, for of which would be > 5 bytes long. Any idea's ?? are there any modules that can split up strings > like this ??
Are you looking for something like this? $ perl -MData::Dumper -e '@a = shift =~ /(.{1,5})/g; print Dumper \@a' abcdefghijklmnopqrstuvw $VAR1 = [ 'abcde', 'fghij', 'klmno', 'pqrst', 'uvw' ]; -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]