# make a file for the ouput my $outputfile = "re-organized.txt"; open POS, '>', $outputfile or die "Cannot open file '$outputfile' to write to because: $!";