http://www.perlmonks.org?node_id=745956


in reply to How to divide a line from a text file into 8 digit chunks

You might be the interested in the following.
open FH,"./input.txt"; while(<FH>) { @arr = ($_ =~ m/.{1,8}/g); print join "***\n",@arr; }