in reply to Re^2: Split a string into items of constant length
in thread Split a string into items of constant length

my $line = $_; chomp $line; my @chunks = unpack "(A5)*", $line;
Just a side note: what's wrong with
chomp; my @chunks = unpack "(A5)*", $_;
?

(or else

while (my $line=<DATA>) { ...
instead.)

Also, more on a stylistic personal preference ground:

foreach my $i (@chunks) { print ">" . $i . "<\n";
why not
print ">$_<\n" for @chunks;
instead?