Hi,

I have tried that :


#!perl --

use strict;
use warnings;
use CGI;
BEGIN { $0 =~ s#^\\\\\?\\## };
use FindBin;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);

my $cgi = CGI->new;
print $cgi->header;
my $jver = 'unknown or jre6 not found';

my $spath = "$ENV{SystemRoot}\\SYSTEM32";
$ENV{PATH} .= ";$spath";

my $osname = lc $^O;
if ($osname eq 'linux') {
      $jver = `./version.sh`;
}
else
{
      my $jrepath = "$FindBin::Bin/jre6/bin/java.exe";

      if (-e $jrepath)
      {
              $jver = `$jrepath -version 2>&1`;
      }
}

print <<END_HTML;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Absolute Path Sample Script Showing How To Get Absolute Path In PERL
And JavaVersion</TITLE>
</HEAD>
<BODY>

<h3>The Absolute Path to this script is: <span style="color:
#0066FF;">$FindBin::Bin</span></h3>
<h3>The script I'm executing is: <span style="color:
#0066FF;">$0</span></h3>
<h3>The output of 'java -version' is: </h3>
<span style="color: #0066FF;">
<PRE>
$jver
</PRE>
</span>
<h3>The Perl binary I'm executing is at: <span style="color:
#0066FF;">$^X</span></h3>

</BODY>
</HTML>
END_HTML

exit;


it works while running with
http://localhost/mydemos/examples/perlscript/foo.pl'
but when I have created exe and tried the same
http://localhost/mydemos/examples/perlscript/foo.exe then its show CGI error





On 6/5/07, Kenneth Ölwing <[EMAIL PROTECTED]> wrote:


 I have tried the same , but after creating exe using pdk its shows

CGI Error The specified CGI application misbehaved by not returning a
complete set of HTTP headers

Umm, what exactly do you mean to have tried??? Again, I'm not skilled in
CGI, but this seems unrelated to the FindBin problem? My suggested
workaround, e.g. the BEGIN is just a snippet of course, insert it into
your original code. Perhaps I misunderstand you completely...

ken1


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to