use strict; use Carp; sub compare_TSD { my %tsd; my ( $tsd{up}, $tsd{dn} ) = @_; croak "compare_TSD called without two defined values" unless ( defined $tsd{up} and defined $tsd{dn} ); my $return_status = ''; for my $arg ( qw/up dn/ ) { my $str = $arg; $str .= " has unusable characters," if ( $tsd{$arg} =~ /[^ACGT]/ ); $str .= " has wrong character count," if ( length( $tsd{$arg} != 10 ); $return_status .= " $str" if ( $str ne $arg ); } return $return_status if ( $return_status ne '' ); return "perfect match" if ( $tsd{up} eq $tsd{dn} ); # not sure what else needs to be checked... }