E
Eric
I am trying to set up a CGI script that will run two other scripts and
then write a short message back to the webpage. I have this mostly
working, except for one strange issue: after using backticks to read
the stdout from the first script, stdout from the second script is
being printed to the page as if it were printed from the CGI script
that acts as the caller. The behaviour disappears if I comment out
the backticks, but then I can't get the information i need from the
stdout of the first script. The code follows:
#!/usr/bin/perl
use CGI;
print "Content-type: text/html\n\n";
my $query = new CGI;
my $pdbCode = $query->param("pdbcode");
my $scriptPath = "~/Sites/etaserver/bin";
my $rankPath = "~/Documents/Templates/Distance\ Matcher/Data/2006/
Data";
my $pdbPath = "~/Documents/Templates/Distance\ Matcher/Data/
2006/2006pdb90\ ET/$pdbCode";
my $pymolPath = "/sw/lib/pymol-py24/bin/pymol";
my $extractMotifArgs = "perl -I$scriptPath \"$scriptPath/
extractmotif.pl\" \"$pdbPath/$pdbCode.clusters\" \"$pdbPath/
$pdbCode.dssp\" \"$pdbPath/$pdbCode.pdb\" \"$pdbPath/$p
my $motifs = `$extractMotifArgs`;
#my $motifs="1,2,3,4";
if($pdbCode =~ /^\d\w{3}\w?$/ && -e $pdbPath) {
$pdbPath =~ s/\\//g;
my $args = ("$pymolPath -cr $scriptPath/createPyMolImage.py --
$pdbCode \"$pdbPath\" $motifs");
system($args);
if (($? >> 8) == 0) {
print "CreatedImage:".$pdbCode;
} else {
print "Error:Unable to Create image";
}
} else {
print "Error:Unable to find PDB Data\n";
}
This is Perl 5.8.6.
Thank you,
Eric
then write a short message back to the webpage. I have this mostly
working, except for one strange issue: after using backticks to read
the stdout from the first script, stdout from the second script is
being printed to the page as if it were printed from the CGI script
that acts as the caller. The behaviour disappears if I comment out
the backticks, but then I can't get the information i need from the
stdout of the first script. The code follows:
#!/usr/bin/perl
use CGI;
print "Content-type: text/html\n\n";
my $query = new CGI;
my $pdbCode = $query->param("pdbcode");
my $scriptPath = "~/Sites/etaserver/bin";
my $rankPath = "~/Documents/Templates/Distance\ Matcher/Data/2006/
Data";
my $pdbPath = "~/Documents/Templates/Distance\ Matcher/Data/
2006/2006pdb90\ ET/$pdbCode";
my $pymolPath = "/sw/lib/pymol-py24/bin/pymol";
my $extractMotifArgs = "perl -I$scriptPath \"$scriptPath/
extractmotif.pl\" \"$pdbPath/$pdbCode.clusters\" \"$pdbPath/
$pdbCode.dssp\" \"$pdbPath/$pdbCode.pdb\" \"$pdbPath/$p
my $motifs = `$extractMotifArgs`;
#my $motifs="1,2,3,4";
if($pdbCode =~ /^\d\w{3}\w?$/ && -e $pdbPath) {
$pdbPath =~ s/\\//g;
my $args = ("$pymolPath -cr $scriptPath/createPyMolImage.py --
$pdbCode \"$pdbPath\" $motifs");
system($args);
if (($? >> 8) == 0) {
print "CreatedImage:".$pdbCode;
} else {
print "Error:Unable to Create image";
}
} else {
print "Error:Unable to find PDB Data\n";
}
This is Perl 5.8.6.
Thank you,
Eric