On Mon, 24 Mar 2003, Soumyadeep nandi wrote:

> Thanks Scott,
> 
> The mistake was in directory permission.
> 
> I have a little more problem in running system command
> from cgi file. Even I wrote a perl file so that I can
> run the system command from the perl file. But the
> perl file is also not executing the system command. I
> could run the short commands from the cgi 
> file.
> 
> I am sending the scripte for your kind considerations,
> 
> Looking forward for your reply.
> With regards,
> Soumyadeep
> 
> 
> 
> I am sending the request from the perl file
> 
> send.pl--------------------------
> #!/usr/bin/perl
> use warnings;
> use strict;
> 
> use LWP::UserAgent;
> 
> use LWP;
> my $ua = new LWP::UserAgent;
> my $req = new HTTP::Request POST =>
> 'http://localhost/cgi-bin/bic_genscan/file3.cgi';
> $req->content_type('application/x-www-form-urlencoded');
> $req->content('st=atgtcgatcagctacgatc');
> my $res = $ua->request($req);
> 
> 
> if($res->is_success){
> print $res->content;
> }else{
> print "Error: ".$res->status_line."\n";
> }
> 
> exit;
> ------------------------------------
> 
> Receiving the request by cgi file

not sure about the above, but this: 

> 
> file3.cgi-----------
> #!/usr/bin/perl -w
> 
>   use CGI;
> 
>   print "Content-type:text/plain\n\n";
> 
>   $query = new CGI;
> 
>   print "blast\n";
> 
>   $str = $query->param('st');
> 
>   print "here the string is : $str\n";
> 
>   system("./perl1.pl");

is just wrong. 

#!/usr/bin/perl -w
use strict;
use CGI qw/:standard :html3 -no_xhtml/;

print header(), start_html(), p("blast");

my $str = param('st') || 'no results';

print p("The 'st' param result is: $str"), end_html();

__END__

now, WHY is the above cgi calling an external process instead of just 
executing the perl code within itself, and if you ARE determined to 
execute a separate process WHY are you not passing it any parameters when 
the recieving script plainly expects SOMETHING as a parameter? 

> -------------------------------------------
> 
> And processing the request by another perl file
> 
> perl1.pl-------------
> 
> #!/usr/bin/perl
> 
> $str = shift;
> print "received the sequence\n";
> system("/home/soumya/Application/BLAST/blastall -p
> blastn -d /home/soumya/Application/BLAST/data/ecoli.nt
> -i /var/www/cgi-bin/bic_genscan/testseq");
> print "done...\n";

and lastly WHY are you not TESTING any of these for success? 

WHY are you not using 

  use strict; 

??

for answers to these and other questions, please post your resonse to the 
perl list rather than to just me.. just because I had time to answer an 
earlier question doesn't mean I have time to answer ALL your questions, 
NOR does it mean that all my answers will be RIGHT. :) 

better to get the concensus of the GROUP instead. post to the 
newsgroup/mailing list where this originated, please. 

thanks :) 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to