Re: prematurely closed filehandle




Jim wrote:
Dr.Ruud wrote:
Jim schreef:

open RUNBLAST2, "| C:\\Inetpub\\wwwroot\\port\\blast\\blastall -e .01
-p blastp -d C:\\Inetpub\\wwwroot\\port\\blast\\db\\gbpoxpep -F F -m 7
-o C:\\Inetpub\\wwwroot\\webtemp\\152895786322021484375.xml ";

You should always check for the open to succeed.

#!perl
use strict ;
use warnings ;
use CGI qw(:standard) ;
use Win32::OLE ;

my $root = 'C:/Inetpub/wwwroot' ;
my $blast = "$root/port/blast" ;

open RUNBLAST2,
"| $blast/blastall" .
" -e .01" .
" -p blastp" .
" -d $blast/db/gbpoxpep" .
" -F F" .
" -m 7" .
" -o $root/webtemp/152895786322021484375.xml"
or die "Ouch: $!" ;

etc.

(untested)

--
Affijn, Ruud

"Gewoon is een tijger."

Dr. Ruud,

Thank you for the reply and the advice!

This script (below) runs fine from the command line, but not in IIS,
when browsed to from Internet Explorer. The error message is:

Ouch: Bad file descriptor at
c:\inetpub\wwwroot\port\blast\blast_xml_run_p.pl line 13.

Might you have any idea what causes the "Bad file descriptor" message?

Jim


#!perl
use strict;
use warnings;
use CGI qw(:standard);
use Win32::OLE;
my $root = 'C:/Inetpub/wwwroot' ;
my $blast = "$root/port/blast" ;
print header(), start_html(-title=>'Invalid Form Variables',
#-BACKGROUND=>'pebblebackgrd.gif',
-BGCOLOR=>'#FFFFFF');
open RUNBLAST2,
"| $blast/blastall" .
" -e .01" .
" -p blastp" .
" -d $blast/db/gbpoxpep" .
" -F F" .
" -m 7" .
" -o $root/webtemp/1528957863220214843.xml"
or die "Ouch: $!" ;
print RUNBLAST2 ">CNPV-WC93:007\nMKSYDDKVKE LYSAIESNDK";
close RUNBLAST2 ;
print end_html();
exit(0);

**************
Clarification:
The "line 13" from the error message corresponds to the "open
BLASTRUN2,..." line.

Jim

.



Relevant Pages