#!/bin/perl
##################################################
#  Print a dot plot for two sequences entered
#  from STDIN, one line each.  
#  This requires familiarity with lists.
##################################################

@input = <STDIN>;         
chomp(@input);            # Remove the newline/CRs 

$sequence1 = $input[0];
$sequence2 = $input[1];

print " $sequence1\n";

@rowNtsList = split(//,$sequence2);
@colNtsList = split(//,$sequence1);

foreach $rowNts (@rowNtsList) {
   print "$rowNts";
   foreach $colNts (@colNtsList) {
      if ($rowNts eq $colNts) {
	 print ".";
      } else {
	 print " ";
      }
   }
   print "\n";
}

exit;                    # End program
