This is a really cool problem. See solution below. Michael, next time post some code please.
Thanks, ZO -------------- #!/usr/bin/perl use warnings; use strict; use Data::Dumper; my(%gap, $animal); while (<DATA>) { if (/>(\w+)/) { $animal = $1; } else { while (/(-+)/) { $gap{$animal}{ length $1 } += s/-+//; } } } print Dumper \%gap; __DATA__ >human acgtt---cgatacg---acgact-----t >chimp acgtacgatac---actgca---ac >mouse acgata---acgatcg----acgt -------------- > > > bio-informatics is a big area in which Perl is involved... there's even > > > a book from O'reilly on the subject... > > > > If what you say is true, then maybe Mike needs to take his questions > > to those list? I mean, if the problem he's describing is common and > > the data format he's using is common, I bet it's been solved already. > > > > Hey mike, have you searched on CPAN (search.cpan.org) for this? > > > > that might be fine- but his question is fundamentally Perl in nature- > he may use the information for bio-informatics, but he is looking for > an answer regarding effective Perl use when dealing with strings- > that's classic Perl and a classic question for this list :) > > i wish i could answer his question right off the bat, but i can't :/ > > awell... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
