Jump to content

Hello!

I'm having a problem on line 12 of this program.The idea of the program is to split a RNA,DNA,Protein sequence into kodons but I get error at line 12.Some help will be nice.If you have any questions please ask I will answer here is the code:

#!usr/bin/perl

$seq = <STDIN>;
chomp $seq;
$size = length $seq;
$size = $size/3;
@kodoni;
for($a=0;$a<$size;$a++){
$NT=0;
$index=0;
$kod=substr($seq,$NT,3);
%kodon=($index);
$kodon{$index}=$kod;
push(@kodoni,$kodon{$index});
$index++;
if($NT<$size){
$NT = $NT+3;};
};
print "Sekvenciq: ".$seq."\n";
print "Razmer na sekvenciqta: ".$size."\n";
print "Kodoni: ";
for($a=0;$a<$#kodoni;$a++){
print @kodoni[$kodon{$a}]." ";
};
P.S: Fixed it !

Link to comment
https://linustechtips.com/topic/758029-perl-help/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×