in reply to Re: Compare two variables
in thread Compare two variables

Thanks for the answer, but I didn't understand the line with DATA. I mean, what exactly DATA contains?

Replies are listed 'Best First'.
Re^3: Compare two variables
by project129 (Beadle) on May 20, 2014 at 01:27 UTC
Re^3: Compare two variables
by AnomalousMonk (Archbishop) on May 20, 2014 at 14:18 UTC

    Here's essentially the same thing without __DATA__:

    c:\@Work\Perl\monks>perl -wMstrict -le "my $seq = 'ATCGGGACG'; my $n = 0; ;; for my $s (qw(TCGTCAGCG ATGCGAAAA TTTTTTTTT TATTTTTTT)) { print qq{\n'$seq' original}; my $idents = (my $same = $s ^ $seq) =~ tr/\x00//; $same =~ tr/\x00-\xff/^ /; print qq{'$s' seq }, $n++; print qq{ $same $idents identities}; } " 'ATCGGGACG' original 'TCGTCAGCG' seq 0 ^^ 2 identities 'ATCGGGACG' original 'ATGCGAAAA' seq 1 ^^ ^ ^ 4 identities 'ATCGGGACG' original 'TTTTTTTTT' seq 2 ^ 1 identities 'ATCGGGACG' original 'TATTTTTTT' seq 3 0 identities
Re^3: Compare two variables
by AnomalousMonk (Archbishop) on May 20, 2014 at 14:28 UTC