noor78 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Everyone. I have a cgi script below which is not working when I launch it in http://localhost/cgi-bin/blastall.cgi.Thanks.
#!/usr/bin/perl use CGI; use warnings; print "Content-type: text/plain\n\n"; $output = system("blast/bin/blastall -i test.na -p blastn -d blast/db/ +vector > result_blast"); open FILE, "result_blast" or die $!; my $lineno = 1; while (<FILE>) { print ": $_"; }

Replies are listed 'Best First'.
Re: cgi problems
by marto (Cardinal) on Apr 09, 2009 at 10:01 UTC

    noor78

    'not working' eh? What does your webserver error log say? Have you read the CGI documentation? You are loading the module, but not using it in the code you have posted.

    Perhaps reading some of CGI Programming from the tutorials section of this site would be a good idea.

    Martin

Re: cgi problems
by Anonymous Monk on Apr 09, 2009 at 10:05 UTC
Re: cgi problems
by targetsmart (Curate) on Apr 09, 2009 at 10:09 UTC
    Re: Prompted to Open or Save CGI Program -- configuration issue?

    Vivek
    -- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.
Re: cgi problems
by wol (Hermit) on Apr 09, 2009 at 15:01 UTC
    I notice that when you invoke blastall, the path is relative. If the CWD of the CGI process is not what you expect, then that would fail. Printing the value of $output (ie send it through the socket to appear the web browser) would help indicate whether this is happening.

    --
    use JAPH;
    print JAPH::asString();

Re: cgi problems
by CountZero (Bishop) on Apr 09, 2009 at 15:12 UTC
    (...) is not working when I launch it
    What is your definition of "not working"? Mine is "I ran the program and now smoke is coming out of the rear of the computer".

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James