[Bioperl-l] foreach (@array)?

Josh Lauricha laurichj at bioinfo.ucr.edu
Wed Sep 10 13:34:53 EDT 2003


On Wed 09/10/03 20:10, Vesko Baev wrote:
> Hi,
> When I start my script, it return results only for first variable in
> @array, but in the raw 'foreach (@array){' in the @array there is two
> or more variables, but anytime it returns the result whit first
> variable:
> 

My guess would be this is an issue with $_, so use

foreach my $id (@mirna) {

rather than:

> foreach (@mirna) { 
>      $id=$_; 
>   while (my $RNA=$DB->next_seq()) { 
>      $RNAid=$RNA->display_id;
>      if ($RNAid eq $id) {
>      $seqRNA=$RNA->seq();
>      }
>      else {next};
> 
> 
>    for (my $i=0; $i<length($geneRNA); $i++) {
>      $subgene=substr($geneRNA,$i,length($seqRNA));
>      $percentage = align_subs($seqRNA, $subgene);
> 
>       if($percent<$percentage) {
>        push (@RNAname,$id);
>        push (@subgene, $subgene);
>        push (@percentage,$percentage);
>        push (@position,($i+1));
>       }
>    }
>   };
>  };
> };
> Thanks! 
> 
> 
> -----------------------------------------------------------------
> http://gsm.ABV.bg - ????? ???? ??????? ?? ???? ??????? !
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 

-- 

----------------------------
| Josh Lauricha            |
| laurichj at bioinfo.ucr.edu |
| Bioinformatics, UCR      |
|--------------------------|


More information about the Bioperl-l mailing list