in reply to Re^2: Split a string into items of constant length
in thread Split a string into items of constant length
Just a side note: what's wrong withmy $line = $_; chomp $line; my @chunks = unpack "(A5)*", $line;
?chomp; my @chunks = unpack "(A5)*", $_;
(or else
instead.)while (my $line=<DATA>) { ...
Also, more on a stylistic personal preference ground:
why notforeach my $i (@chunks) { print ">" . $i . "<\n";
instead?print ">$_<\n" for @chunks;
|
|---|