in reply to RE: RE: RE: Writing the contents of an array to a file
in thread Writing the contents of an array to a file

Note also that while each pair of lines of code below produce the same output:

print FILE "@array"; print FILE join $", @array; print FILE @array; print FILE join $,, @array;
they are not equivalent in terms of performance. Only print FILE @array avoids building a potentially huge string in memory before writing. In practice, the speed improvement is usually small (or even negative) but I prefer to allow for huge arrays and avoid the join if I'm just going to write the result to a file and then throw the constructed string away.

Though I do find appealing the way that using join prevents your code from breaking if you accidentally sneak a scalar context into the mix (typing a "." when you meant a ",", for example).

        - tye (but my friends call me "Tye")