|
Posted by Gunnar Hjalmarsson on February 21, 2008, 11:01 pm
Please log in for more thread options Rose wrote:
> I find the following codes will give match for 'C' to '-', what's the
> problem?
>
> $preseq = "C-";
> @preseq = splilt '', $preseq;
>
> $curseq = "--";
> @curseq = splilt '', $curseq;
>
> $len = @curseq;
> $len--;
>
> if ($preseq[$len-1] == $curseq[$len-1]) {
> print "P:$preseq[$len-1]\n";
> print "C:$curseq[$len-1]\n";
> }
The problem is that you ask for help with debugging, while you haven't
first asked Perl for help by using strictures and warnings.
Add
use strict;
use warnings;
to the beginning of the script, and make the adjustments needed to get
rid of possible error and warning messages.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
|