On Thu, Oct 14, 2004 at 11:02:06AM -0600, Michael Robeson wrote:

> I have a set of data that looks something like the following:

> So, my problem is that I think I know some of the bits of code to put 
> into place the problem is I am getting lost on how to structure it all 
> together.

>                I like to try and figure things out on my own if I can, 
> so even pseudo code would be of great help!

Here's some code that works, incorporating most of your ideas.  It's
only a partial solution, but it think it covers the bit that was causing
you problems.  I'll present it without comment, but I'm sure people will
be able to explain anything you don't understand.

#!/usr/bin/perl -w

use strict;
use Data::Dumper;

while (<DATA>)
{
    print, next unless /-/;
    my %gaps;
    push @{$gaps{length $1}}, pos() + 1 - length $1 while /(-+)/g;
    print Dumper \%gaps;
}

__DATA__
human
acgtt---cgatacg---acgact-----t
chimp
acgtacgatac---actgca---ac
mouse
acgata---acgatcg----acgt

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to