print OUTFILE join (",", /(.{1,10})/g), "\n" #### Creating file took 9.90625 seconds Splitting file using regexp took 12 seconds