in reply to writing an array of data to a file

Another couple of tips:

1/ it is generally considered good practice to use the three parameter open:

open (OUTPUTFILE, '>', $position_output_path) or die "Could not open . +..";

2/ print @array prints the stringified contents of an array without any additional whitespace. print "@array" prints the stringified contents of an array with $, added between each item.

Note also that join can be used to inster whatever seperators you like between elements of an array.

Consider:

my $var; my @array = ('a', 1.1, \$var); print @array; print "\n@array"; print "\n", join "\n", @array;

Prints:

a1.1SCALAR(0x182f68c) a 1.1 SCALAR(0x182f68c) a 1.1 SCALAR(0x182f68c)

DWIM is Perl's answer to Gödel