-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 14 January 2002 11:55, Gerald Richter wrote:
> > 4 $VAR1 = bless( { 'webmaster' => 'John Smith' },
>
> 'HTML::Embperl::DOC::_2' );
>
> Looks like there is a Data::Dumper output that is printed to STDOUT instead
> of OUT, because the Data::Dumper output comes before the headers, the
> browser can't interpret the headers.
>
> Do you have inserted a "print Dumper" or something similar anywhere ?
>
> Gerald
>
>
Here's what I just did to test it again:
1. I reinstalled HTML-Embperl-2.0b5.tar.gz using Cpan.pm.
Install was clean. I did not use mod_perl option. I install into local perl
installation in my homedir. I use latest stable Perl 5.6.1, built from source.
2. Here's my full epocgi.pl:
#!/home/perlnow/local/bin/perl
......
# $Id: epocgi.pl.templ,v 1.2 2001/05/15 10:41:23 richter Exp $
#
###################################################################################
use HTML::Embperl ;
use HTML::EmbperlObject ;
my $Logfile = $ENV{EMBPERL_LOG} || $HTML::Embperl::DefaultLog ;
my $rc ;
my $ioType ;
my %req ;
HTML::EmbperlObject::ScanEnvironment (\%req) ;
$req{'object_base'} = 'base.emb';
$req{'object_stopdir'} = '/home/perlnow/public_html';
$req{'inputfile'} = $ENV{PATH_TRANSLATED} ;
$ioType = HTML::Embperl::epIOCGI ;
HTML::Embperl::XS_Init ($ioType, $Logfile, $DebugDefault) ;
tie *LOG, 'HTML::Embperl::Log' ;
$req{'uri'} = $ENV{SCRIPT_NAME} ;
$req{'cleanup'} = 0 ;
$req{'cleanup'} = -1 if (($req{'options'} &
HTML::Embperl::optDisableVarCleanup)) ;
$req{'options'} |= HTML::Embperl::optSendHttpHeader ;
#
###################################################################################
use HTML::Embperl ;
use HTML::EmbperlObject ;
my $Logfile = $ENV{EMBPERL_LOG} || $HTML::Embperl::DefaultLog ;
my $rc ;
my $ioType ;
my %req ;
HTML::EmbperlObject::ScanEnvironment (\%req) ;
$req{'object_base'} = 'base.emb';
$req{'object_stopdir'} = '/home/perlnow/public_html';
$req{'inputfile'} = $ENV{PATH_TRANSLATED} ;
$ioType = HTML::Embperl::epIOCGI ;
HTML::Embperl::XS_Init ($ioType, $Logfile, $DebugDefault) ;
tie *LOG, 'HTML::Embperl::Log' ;
$req{'uri'} = $ENV{SCRIPT_NAME} ;
$req{'cleanup'} = 0 ;
$req{'cleanup'} = -1 if (($req{'options'} &
HTML::Embperl::optDisableVarCleanup)) ;
$req{'options'} |= HTML::Embperl::optSendHttpHeader ;
$rc = HTML::EmbperlObject::Execute (\%req) ;
#close LOG ;
HTML::Embperl::XS_Term () ;
if ($rc)
{
$time = localtime ;
my $req = join ':', %req;
print <<EOT;
Status: $rc
Content-Type: text/html
<HTML><HEAD><TITLE>Embperl Error</TITLE></HEAD>
<BODY bgcolor=\"#FFFFFF\">
<H1>epocgi Server Error: $rc</H1>
[ $req ]<br>
Please contact the server administrator, $ENV{SERVER_ADMIN} and inform them
of the time the error occurred,
$ENV{SERVER_SOFTWARE} HTML::Embperl $HTML::Embperl::VERSION [$time]<P>
</BODY></HTML>
EOT
}
I just added 2 lines :
$req{'object_base'} = 'base.emb';
$req{'object_stopdir'} = '/home/perlnow/public_html';
3. my .htaccess in public_html dir:
DirectoryIndex index.html /cgi-bin/rightsql.CGI
Options Includes
AddType text/x-server-parsed-html .html
ErrorDocument 404 /error.htm
#DirectoryIndex index.emb index.html
AddType text/html .emb
<Files *.emb>
Action text/html /cgi-bin/epocgi.pl
</Files>
4. base.emb in public_html dir (DocRoot for my vhost)
<HTML>
<HEAD>
<TITLE>Some title</TITLE>
</HEAD>
[-
$req = shift;
$req->{webmaster} = 'John Smith'
- -]
<BODY>
[- Execute ('*') -]
</BODY>
</HTML>
5. t.emb in public_html:
[-
$req = shift;
- -]
[+ 2+2 +]
- ----------
You can see output @ http://www.perlnow.com/t.emb:
4 HTTP/1.1 200 OK Date: Mon, 14 Jan 2002 20:31:18 GMT Server: Apache/1.3.6
(Unix) PHP/4.0.3pl1 mod_gzip/1.3.19.1a mod_ssl/2.3.6
OpenSSL/0.9.3a Content-Length: 2 Keep-Alive: timeout=10, max=99 Connection:
Keep-Alive Content-Type: text/html 4
4 is printed twice for some reason: one before and one after the header.
Content-Length is also 2, though I just print 1 char
I used Data::Dumper [+ Dumper $req +] in prev version (as I often do on other
sites using EmbPerlObject) but I got rid of it now so [+ 2+2 +] is
all t.emb has.
Exact same setup works on my machine at home running
1.3.22/mod_perl/1.26/Perl 5.6.1/Embperl 1.3.22_2.0b3
And on perlnow.com under EmbPerl 1.3.4
Which leads me to think that problem is apache version specific. (they use
Apache/1.3.6 @ host for perlnow.com)
Thanks
- --
Dimitri Ostapenko,
Ostapenko Consulting Inc.
perl/java/internet
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE8Q0vCZ9+Y+uWmwdgRApQ+AKCNS4a8XUVi0QzKhQY7d66eWQOOvgCfXlgz
MmpinVn/47Ck5XOLDb5TXyo=
=LEyy
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]