or download this
#!/usr/bin/perl -w
#This code joins randomly haplotypes two by two from the output given
+by Eli's program with an arbitrary number of populations. It needs a
+2 allele output. It is the infile for R calculation.
...
+ }
+ }
print "$currentPop\n";