#!/usr/bin/perl use strict; use Getopt::Long; my $input_file_1 = ""; my $input_file_2 = ""; my $iteration = "dot"; my $separator = "\t"; ################################################################################ ########################## Get the current version of the database and use that GetOptions( "file_1=s" => \$input_file_1, "file_2=s" => \$input_file_2, "iteration=s" => \$iteration, "separator=s" => \$separator ); my $file_identifier_1 = "<".$input_file_1; my $file_identifier_2 = "<".$input_file_2; open( DATA, "$file_identifier_1" ) || die "$!"; my @array_1 = ; close(DATA); open( DATA, "$file_identifier_2" ) || die "$!"; my @array_2 = ; close(DATA); if($separator eq "") { $separator = "\t"; } elsif($separator eq "tab") { $separator = "\t"; } elsif($separator eq "space") { $separator = " "; } elsif($separator eq "comma") { $separator = ","; } elsif($separator eq "new_line") { $separator = "\n"; } if($iteration eq "" or $iteration eq "dot") { for(my $i = 0; $i < @array_1; $i++) { chomp($array_1[$i]); print("$array_1[$i]".$separator."$array_2[$i]\n"); } } elsif($iteration eq "cross") { for(my $i = 0; $i < @array_1; $i++) { for(my $j = 0; $j < @array_2; $j++) { chomp($array_1[$i]); chomp($array_2[$j]); print("$array_1[$i]".$separator."$array_2[$j]\n"); } } } elsif($iteration ne "cross" or $iteration ne "dot") { print("You may have a spelling mistake in your \niteration option, please input either dot or cross\n"); }