[Bioperl-l] recursion limit reached for a gbk file
Dave Messina
David.Messina at sbc.su.se
Thu Jun 10 19:39:14 UTC 2010
Hi Gopal,
This is not a BioPerl question, so this list is really not the place for it.
However, here's the first Google hit on your error message, which provides a solution:
http://www.perlmonks.org/?node_id=810857
The short answer is that it's sort of a bug in Perl which is fixed in Perl version 5.12.
Also, this is probably not a good approach for long strings. What is this technique being used for in "Beginning Perl for Bioinformatics"?
Dave
On Jun 10, 2010, at 6:24 PM, Gopal wrote:
> Hi,
>
> I get a error message "Complex regular subexpression recursion limit
> (32766) exceeded " when I try to parse CDS from a microbial genbank file.
> Apparently recursion limit is universal and that means,
> others have somehow overcome this problem.
>
> The subroutine that triggers this error is pasted below:
>
> (based on "Beginning perl for Bioinformatics" as I am trying to adapt an
> example in that book for my work)
>
>
> $fh = open_file($library);
>
> $offset = tell($fh);
>
> while( $record = get_next_record($fh) ) {
>
> my $locus=( );
>
> ($annotation, $dna) = get_annotation_and_dna($record);
>
> $offset = tell($fh);
>
>
>
> # Extract the fields of the annotation
> %fields = parse_annotation($annotation);
>
>
> Sub-routine that triggers the error message:
>
>
> sub parse_annotation {
>
> my($annotation) = @_;
> my(%results) = ( );
>
> while( $annotation =~ /^[A-Z].*\n(^\s.*\n)*/gm ) {
> my $value = $&;
> (my $key = $value) =~ s/^([A-Z]+).*/$1/s;
> $results{$key} = $value;
> }
>
> return %results;
> }
>
> thanks,
>
> -gopal
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
More information about the Bioperl-l
mailing list