tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Byers <r.ted.by...@gmail.com>
Subject RE: Another question about CGI on Tomcat 6 - access
Date Wed, 27 Aug 2008 01:41:26 GMT

My Martin,

What was labelled as array2d is in fact array2d.pl  There is nothing more in
it than what you see in my first post.

If you want me to email it to you, send me an email address.  I have not
found, in the interface to nabble, a way to attach a file to a message,
email or otherwise.

I can email both scripts if you wish.  Just tell me where, but the contents
of both are provided in the first message in this thread.

Thanks

Ted

mgainty wrote:
> 
> 
> please supply array2d.pl
> 
> thanks,
> Martin 
> ______________________________________________ 
> Disclaimer and confidentiality note 
> Everything in this e-mail and any attachments relates to the official
> business of Sender. This transmission is of a confidential nature and
> Sender does not endorse distribution to any party other than intended
> recipient. Sender does not necessarily endorse content contained within
> this transmission. 
> 
> 
>> Date: Tue, 26 Aug 2008 15:44:35 -0700
>> From: r.ted.byers@gmail.com
>> To: users@tomcat.apache.org
>> Subject: Another question about CGI on Tomcat 6 - access
>> 
>> 
>> I have CGI working.  Now I have a question about having one cgi script
>> execute another script (both simple enough to be appended below).
>> 
>> I can run either within Emacs, or from a commandline, and get the obvious
>> output.  Running format_test I get the following output:
>> 
>> Content-type: text/html
>> 
>> <HTML><HEAD>
>> <TITLE>Arrays</TITLE>
>> </HEAD>
>> 
>> <BODY>
>> a	0.0550001	0.06	$0.06<br>
>> b	150.3449	150.34	$150.34<br>
>> c	1158.435	1158.43	$1,158.43<br>
>> mc	-1158.435	-1158.43	$-1,158.43<br>
>> d	100256147.258	100256147.26	$100,256,147.26<br><br><br>
>> 
>> 
>> <PRE>\n12
>> 13
>> 2
>> 3
>> 
>> </PRE>\n</BODY>
>> 
>> No surprises.  However, when the same script is executed as a cgi script,
>> the output from array2d.pl is missing:
>> <HTML><HEAD>
>> <TITLE>Arrays</TITLE>
>> </HEAD>
>> 
>> <BODY>
>> a	0.0550001	0.06	$0.06<br>
>> b	150.3449	150.34	$150.34<br>
>> c	1158.435	1158.43	$1,158.43<br>
>> mc	-1158.435	-1158.43	$-1,158.43<br>
>> d	100256147.258	100256147.26	$100,256,147.26<br><br><br>
>> 
>> 
>> <PRE>\n
>> </PRE>\n</BODY>
>> 
>> I do not get any error messages at all.
>> 
>> Why am I not getting any output at all from the child processes?  I NEED
>> to
>> be able to invoke another perl script, ideally from another directory
>> outside the Tomcat directory tree, have it complete successfully and
>> return
>> a message to that effect.  In due course, I will use the perl cgi package
>> and redirect the browser to a JSF page in my web app, hopefully
>> maintaining
>> the session prviously established by my app.
>> 
>> Help getting this working would be greatly appreciated.
>> 
>> Thanks
>> 
>> Ted
>> ====Appendix==========================
>> Here are two trivially simple scripts:
>> 
>> #array2d
>> # I used this to help a colleague learn the basics of using arrays in
>> Perl.
>> use strict;
>> 
>> my @matrix;
>> my @vector = [1,2,3];
>> push (@matrix,@vector);
>> @vector = [11,12,13];
>> push (@matrix,@vector);
>> print "$matrix[1][1]\n";
>> print "$matrix[1][2]\n";
>> print "$matrix[0][1]\n";
>> print "$matrix[0][2]\n";
>> 
>> And here is the main CGI script (derived from a script I used to help a
>> colleague learn about formatting numbers in Perl)
>> #format_test.pl
>> #!c:/perl/bin/perl.exe
>> use strict;
>> print <<"END";
>> Content-type: text/html
>> 
>> <HTML><HEAD>
>> <TITLE>Arrays</TITLE>
>> </HEAD>
>> 
>> <BODY>
>> END
>> 
>> my $a = 0.0550001;
>> my $b = 150.3449;
>> my $c = 1158.435;
>> my $mc = -1158.435;
>> my $d = 100256147.258;
>> 
>> my $rv1a = sprintf("%.2f",$a);
>> my $rv1b = sprintf("%.2f",$b);
>> my $rv1c = sprintf("%.2f",$c);
>> my $rv1mc = sprintf("%.2f",$mc);
>> my $rv1d = sprintf("%.2f",$d);
>> 
>> my $rv2a = commify($rv1a);
>> my $rv2b = commify($rv1b);
>> my $rv2c = commify($rv1c);
>> my $rv2mc = commify($rv1mc);
>> my $rv2d = commify($rv1d);
>> 
>> print "a\t$a\t$rv1a\t\$$rv2a<br>\n";
>> print "b\t$b\t$rv1b\t\$$rv2b<br>\n";
>> print "c\t$c\t$rv1c\t\$$rv2c<br>\n";
>> print "mc\t$mc\t$rv1mc\t\$$rv2mc<br>\n";
>> print "d\t$d\t$rv1d\t\$$rv2d<br><br><br>\n\n\n";
>> 
>> my $output = `array2d.pl`;
>> print '<PRE>\n';
>> print "$output\n";
>> print '</PRE>\n';
>> print '</BODY>';
>> sub commify {
>>   my $value = reverse $_[0];
>>   $value =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g;
>>   return scalar reverse $value;
>> }
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Another-question-about-CGI-on-Tomcat-6---access-tp19171791p19171791.html
>> Sent from the Tomcat - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
> 
> _________________________________________________________________
> See what people are saying about Windows Live.  Check out featured posts.
> http://www.windowslive.com/connect?ocid=TXT_TAGLM_WL_connect2_082008
> 
http://www.nabble.com/file/p19173428/array2d.pl array2d.pl 
-- 
View this message in context: http://www.nabble.com/Another-question-about-CGI-on-Tomcat-6---access-tp19171791p19173428.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message