However the "converted file" only contained "\n"s.
I'm no guru, but I worked out that (I think) you need a split before the join, or you won't have a list that join requires.
print OUTFILE join (",", (split /(XXXXXXXXXX)/)), "\n";
worked, sort of, for me - I couldn't get your /(.{,10})/ pattern to work, although I think I understand what it's trying to match - any 10 chars exactly and reflect those in the stream as well as the other characters - which in this case aren't any. The resulting file simply had "\n"s as the split didn't seem to find a match.
This then took around 20 seconds...
$ perl file.pl Creating file took 3.40489602088928 seconds Splitting file using regexp took 19.5581229925156 seconds
This results in lines containing collections of 10 sets of the following ",XXXXXXXXXX," so that 2 commas appear between adjacent groups of X's and at the beginning and end of each line.
In reply to Re: Re: What's the most efficient way to write out many lines of data?
by hagen
in thread What's the most efficient way to write out many lines of data?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |