Here's your code modified to do what you want. The changes are pretty simple, but you need to look carefully, work out what changed and understand why they are necessary if you are going to do anything more complex than this.
#! perl -slw use strict; my $genome1 = 'ACACTTGCATACTGATCATGACTTGACACACTTGCATACTGATCATGACTTGACACACTTGCATACTGA +TCATGACTTGACACACTTGCATACTGATCATGACTTGAC'; my $genome2 = 'ACTACGACTGCATGACTCCGATGACTGACTACGACTGCATGACTCCGATGACTGACTACGACTGCATGA +CTCCGATGACTGACTACGACTGCATGACTCCGATGACTG'; my $mismatches = get_mismatches ($genome1, $genome2); my @strings = ($genome1, $mismatches, $genome2); for (my $x = 0; $x < length ($strings [0]); $x +=60) { print join ("\n", map (substr ($strings[$_], $x, 60), 0..2 )) . " +\n"; } exit; sub get_mismatches { ($genome1, $genome2) = @_; my $mismatches = ''; my $length= length ($genome1); my $position; my $count = 0; for ($position = 0; $position < $length; ++$position) { if (substr($genome1, $position, 1) eq substr ($genome2, $posit +ion, 1)) { $mismatches .= "-"; } else { $mismatches .= "*"; } } return $mismatches; } __END__ C:\test>214064 ACACTTGCATACTGATCATGACTTGACACACTTGCATACTGATCATGACTTGACACACTT --*****-****---****--******--*****-****---****--******--**** ACTACGACTGCATGACTCCGATGACTGACTACGACTGCATGACTCCGATGACTGACTACG GCATACTGATCATGACTTGACACACTTGCATACTGATCATGACTTGAC *-****---****--******--*****-****---****--****** ACTGCATGACTCCGATGACTGACTACGACTGCATGACTCCGATGACTG C:\test>
Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.
In reply to Re: more interweaving
by BrowserUk
in thread more interweaving
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |