what i was planning to do with the variable is this: ---------------------------------------------------- foreach $str(@array){ if($str=~/\w+/){@strs=split(//,$str); for($i=1;$i<=scalar(@strs);$i++){ print "$strs[$i] "; if($i%5==0){print"\n";} } } } } this is how my webpage result should look like: ----------------------------------------------- >ID_106 ACTAG CTACG ATATA TTATA TATAT