Gunnar:
If vi editor cannot be called through perl cgi under web browser, what I can do if i want to call an application in my script. My case is "phrap"- a perl application, which can be used like phrap fasta1 at terminal to generate several text files.
Thanks a lot,
justin
Note: forwarded message attached.
Note: forwarded message attached.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--- Begin Message --- Xiangli Zhang wrote:Gunnar Hjalmarsson wrote:
system(" perl test1.pl");
This is a better way to run another Perl program:
eval "require 'test1.pl'" or die "Couldn't require test1.pl: $@";
system("phrap fasta1");
system("vi test.pl");
system("phrap fasta1") == 0 or die "'phrap fasta1' failed: $?"; system("vi test.pl") == 0 or die "'vi test.pl' failed: $?";
Following your instruction,
They were suggestions, not instructions. :)
I ran my cgi under internet browser Mozzilla and at terminal.
However, it output correctly for terminal(it automatically open vi editor and open the file "test.pl),
Aha, are you trying to open the vi editor? Then I don't think I'm able to help you; not sure if it's even possible to do that from a CGI script.
main page[m[m[0m[H[2J[24;1H"test.pl" [readonly] 6L,
95C[1;1H#!/usr/bin/perl -w print "Content-Type: text/html\n\n";
print "this is phrap testing file"; [1m[34m~ [8;1H~ [9;1H~
[10;1H~ [11;1H~ [12;1H~ [13;1H~ [14;1H~ [15;1H~ [16;1H~
[17;1H~ [18;1H~ [19;1H~ [20;1H~ [21;1H~ [22;1H~ [23;1H~ [1;1H[24;1H[0mVim: Error reading input, exiting... Vim:
Finished. [24;1H Software error:
'vi test.pl' failed: 256 at /var/www/cgi-bin/jun06_uploadFile.cgi line 78.
Among all the funny characters, I notice [readonly]. Can it possibly be that you need to change the permissions for the file to make it editable by CGI?
But, to be honest, I don't think that's enough. Hopefully somebody else is willing to jump in and advise.
-- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
--- End Message ---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>