Re: how to execute a perl file in cgi?

2004-10-10 Thread Bill Jones

--- Gunnar Hjalmarsson [EMAIL PROTECTED] wrote:

 Bill Jones wrote:
  The third way - `` (back-ticks) is highly discouraged.
 
 Discouraged? Why? I thought that was depending on what exactly it is
 you want to do, e.g. whether you want to capture the output from the
 script you run.


Well, it is definitely a matter of taste, true.  There are cleaner ways
to capture the external program's output.

Personally I have seen, in my short time programming in Perl, that some
versions of Perl have at times executed `` (back-ticks) as if they were
contained inside a BEGIN block -- that is prior to executing my code in
correct sequence.

Don't misundertsnad me, I have used back-ticks a lot.  I just feel
there are better (read: clearer) ways to start an external program from
Perl.

:)
-Sx-


=
-Sx-
seeking employment: http://youve-reached-the.endoftheinternet.org/



__
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: how to execute a perl file in cgi?

2004-10-10 Thread Bill Jones

--- Xiangli Zhang [EMAIL PROTECTED] wrote:

 Since I want to analyse a complicated problem involved with one
 file.pl, I am suspect the .pl file was not executed. I tried with
 very simple file.pl only printing one line, but it does not work. The
 following is the code:
  
 the cgi file
  
  
 #!/usr/bin/perl
 use lib '/srv/www/cgi-bin/phrap';
 
 print Content-type: text/html\n\n;
 print htmlheadtitlePerl CGI Example # 2;
 print /title/headbodyh1;
 print Alignment Result /h1p;
 print pre;
 
 system(perl, /srv/www/cgi-bin/phrap/testL.pl);
 print /pre;
 print /p;
 print /body/html;
 
 the .pl file testL.pl
  
 #!/usr/bin/perl
 print %%\n\n;
 


A series of Percent signs is significant to the resulting web browser;
please try to use a sim ple, plain old, ASCII text - maybe just Hi, I
am the testL programs output ???

  
 testL.pl is in the folder '/srv/www/cgi-bin/phrap', both of the files
 have maximum permissions
  
 I am suspecting the problem is related to configuration of Apache web
 server. Is it possible? Since, the exact files work fine in one
 server, but not in the other. 
  
 I am not so familiar with Apache configuration, just know some basic
 things.
  
 Any suggestions?


How do you know that the use lib is working?  Can you prove the
programs both work for the command line first - before you try them as
CGIs?

As far as apache is concerned I suggest:

http://httpd.apache.org/docs-2.0/howto/cgi.html

:)
-Sx-



=
-Sx-
seeking employment: http://youve-reached-the.endoftheinternet.org/

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response