[Bioperl-l] problem with Primer3: too many files open

Andy Nunberg andyn108 at gmail.com
Thu Jan 19 13:28:36 EST 2006

Hi, I am using bioperl-1.4 running Primer3 to select a bunch of primers.
While running the script, I get an exception at the same point with
the following error:

------------- EXCEPTION  -------------
MSG: Can't open RESULTS:Too many open files
STACK Bio::Tools::Run::Primer3::run
STACK (eval) find_primers_first_pass.pl:183
STACK main::_primer3 find_primers_first_pass.pl:182
STACK main::get_primer find_primers_first_pass.pl:141
STACK toplevel find_primers_first_pass.pl:86


Now if I take this sequence out of the list and run the script, it
runs just fine.

here is the subroutine calling primer3:
sub _primer3{
    my $primer3=Bio::Tools::Run::Primer3->new(-seq=>$seq,-verbose=>0,-flush=>1);
    my @qual = @{$seq->qual};
    #set the start of the search window for primer3
    my $primer3_start=1;
    if($seq->length > ($window+100)){
    #set up primer3
    $primer3->add_targets('PRIMER_GC_CLAMP'=>1) unless($no_gc_clamp);

    #run primer3
    my $prim3_results;
    eval {
    die $seq->id." :$@" if ($@);

    #fetch result for the first primer
    my $hash_ref=$prim3_results->primer_results(0);
    return $hash_ref;


any suggestions? any thoughts on why I am getting the error to begin with?

More information about the Bioperl-l mailing list