in reply to How can one decompose a string into an array of 8 character blocks?

TIMToady using core module Text::Wrap:
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Text::Wrap qw(wrap $columns $huge); $columns = 8; # Wrap at 8 characters my @array; while (<DATA>){push @array, wrap('', '', $_);} print Dumper (\@array) __DATA__ rnbqkbnrpppppppp PPPPPPPPRNBQKBNR

HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
  • Comment on Re: How can one decompose a string into an array of 8 character blocks?
  • Download Code