in reply to How to divide a line from a text file into 8 digit chunks
my @array = split m/(.{8})/, $string; @array = grep length, @array
Or a bit nicer
push @array, $1 while $str =~ m/(.{1,8})/g;
TIMTOWTDI (though I personally prefer the unpack solution)
(Update: tested and fixed the solutions)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to divide a line from a text file into 8 digit chunks
by ozgurp (Beadle) on Feb 24, 2009 at 09:40 UTC | |
by moritz (Cardinal) on Feb 24, 2009 at 10:31 UTC | |
by AnomalousMonk (Archbishop) on Feb 24, 2009 at 14:41 UTC |