Mailing List Archive

ANNOUNCE: HTML::Embperl 1.3b4
The URL

ftp://ftp.dev.ecos.de/pub/perl/embperl/HTML-Embperl-1.3b4.tar.gz

has entered CPAN as

file: $CPAN/authors/id/G/GR/GRICHTER/HTML-Embperl-1.3b4.tar.gz
size: 278004 bytes
md5: 9fa246a00ad7087ef952b6e84901d076


Embperl is a module for embedding Perl code in HTML pages. See
http://perl.apache.org/embperl/ (english) or http://www.ecos.de/embperl/
(german) for more informations.

The main news in this release are the enhanced features of EmbperlObject,
which now allows sub's to be called as methods, were methods in the
requested page overwrite methods in the base template. Additionaly it's
possible to use the Embperl request object to store per request data and
pass them between different parts of a page.

Still missing is the support for Apache::Session 1.50 and higher, but this
is coming soon after the Perl conference.

Enjoy
Gerald

Changes since 1.3b3:

- New $escmode (or EMBPERL_ESCMODE) to disable the possiblilty
to turn off escaping with a leading backslash. Adding 4 to
any escmode will cause Embperl to do no special processing
on the backslash. This is mainly to avoid problems with
cross site scripting issuse, where people are able to enter
aribtary HTML. Spotted by Dirk Lutzebaeck.
- Characters between 128 and 159 are all HTML escaped now to
avoid problems with buggy browser, which were reported to
treat the chars 139 and 141 as < and >. Spotted by Dirk Lutzebaeck.
- If a requested file is not found when using EmbperlObject as handler,
the file given by C<EMBPERL_OBJECT_FALLBACK> is displayed instead.
If C<EMBPERL_OBJECT_FALLBACK> isn't set a staus 404, NOT_FOUND is
returned as usual.
- "perl Makefile.PL debug" will build debugging information for
gdb/ms-vc++ into Embperl library.
- test.pl can take a bunch of new options for debugging Embperl itself.
See make test TESTARGS="--help".
- Embperl 1.x and 2.x share now the same Makefile.PL and test.pl
- Added new debug flag dbgObjectSerach which logs the EmbperlObjects
work when searching the correct file.
- If import parameter is given to Execute, Perl code is compiled, but
only [! !] blocks are executed (to allow sub definitions on import)
- Space is converted to %20 instead of +, because that is more generic.
Suggested by Michael Blakely.
- EmbperlObject now automaticly defines all subs that are declared
inside the base template and inside the requested page, so it isn't
neccessary anymore to call Execute with import => 0 for them.
- Every Embperl Page now get passed a request object (which can be
obtained
from $_[0]). The request object is a hash reference which is blessed
into the package HTML::Embperl::Req. Embperl itself don't uses the
hash, so
you are free to populate it and pass data between different pages of
one request.
- EmbperlObject now setup the inherence so that
request page -ISA->
base template -ISA->
EMBPERL_OBJECT_HANDLER_CLASS (if defined) -ISA->
HTML::Embperl::Req
and the Embperl request object is blessed into the packages of the
requested page, so you can do methods calls to subs that are defined
inside the requested page.
- correct spelling error and renamed ScanEnvironement to ScanEnvironment.
(ScanEnvironement still works).
- EmbperlObject can now be used also offline (via
HTML::EmbperlObject::Execute)
- MailFormTo and HTML::Embperl::Mail::Execute now have a configuration
directive EMBPERL_MAILHELO, can be used to specify the host/domain for
the
HELO/EHLO command. Suggested by Remco Brink.
- Fixed a bug that caused the default drive to be incorrectly set on Win
32.


-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
Re: ANNOUNCE: HTML::Embperl 1.3b4 [ In reply to ]
Just tried it and there's something quite wrong, it says

[Mon Jul 17 17:28:02 2000] [error] Undefined subroutine
&HTML::EmbperlObject::handler called.

Bareword "HTML::Embperl::optDisableVarCleanup" not allowed while "strict
subs" in use at
/usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
123.
Bareword "HTML::Embperl::optSendHttpHeader" not allowed while "strict
subs" in use at
/usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
124.
Bareword "HTML::Embperl::dbgObjectSearch" not allowed while "strict
subs" in use at
/usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
163.
[Mon Jul 17 17:28:11 2000] [error] BEGIN not safe after
errors--compilation aborted at
/usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
250.

Exactly the same files work with 1.3b3 - what's wrong? Make test is OK
for both betas.

- Robert



P.S. Here are the files:


.htaccess
------------------------------------------
PerlSetEnv EMBPERL_OPTIONS 8208
PerlSetEnv EMBPERL_ESCMODE 0
PerlSetEnv EMBPERL_DEBUG 1
<FilesMatch ".*\.html$">
PerlSetEnv EMBPERL_FILESMATCH "\.html$"
PerlSetEnv EMBPERL_OBJECT_BASE base.html
SetHandler perl-script
PerlHandler HTML::EmbperlObject
Options ExecCGI
</FilesMatch>


base.html
------------------------------------------
<html>
<head>
<title>Example</title>
</head>
<body>
<h1>Example</h1>
[- Execute ('*') -]
</body>
</html>


index.html
------------------------------------------
<p>Toto je <b>index.html</b></p>
<br>
Re: ANNOUNCE: HTML::Embperl 1.3b4 [ In reply to ]
Moreover, Mail.pm line 69 seems to have more ')' then necessary.

- Robert
RE: ANNOUNCE: HTML::Embperl 1.3b4 [ In reply to ]
>
> Moreover, Mail.pm line 69 seems to have more ')' then necessary.
>

sh....

Yes, there is one ( missing at the start of line 68.

Gerald
RE: ANNOUNCE: HTML::Embperl 1.3b4 [ In reply to ]
>
> Just tried it and there's something quite wrong, it says
>
> [Mon Jul 17 17:28:02 2000] [error] Undefined subroutine
> &HTML::EmbperlObject::handler called.
>
> Bareword "HTML::Embperl::optDisableVarCleanup" not allowed while "strict
> subs" in use at
> /usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
> 123.
...

>
> .htaccess
> ------------------------------------------
> PerlSetEnv EMBPERL_OPTIONS 8208
> PerlSetEnv EMBPERL_ESCMODE 0
> PerlSetEnv EMBPERL_DEBUG 1
> <FilesMatch ".*\.html$">
> PerlSetEnv EMBPERL_FILESMATCH "\.html$"
> PerlSetEnv EMBPERL_OBJECT_BASE base.html
> SetHandler perl-script
> PerlHandler HTML::EmbperlObject
> Options ExecCGI
> </FilesMatch>
>

Does it change anything when you add a

PerlModule HTML::EmbperlObject

to your httpd.conf (not .htaccess)

Gerald
RE: ANNOUNCE: HTML::Embperl 1.3b4 [ In reply to ]
> >
> > Does it change anything when you add a
> >
> > PerlModule HTML::EmbperlObject
> >

and

PerlModule HTML::Embperl
PerlModule HTML::EmbperlObject

any changes?

I am about to leave to the conference. I hope I can get my email there.
Since the tests runs ok, you may try to look at the test's httpd.conf
(test/conf/httpd.conf and test/conf/startup.pl) and see what is different

Gerald


> > to your httpd.conf (not .htaccess)
>
> Yes ;-)
>
> Shutting down http: [ OK ]
> Starting httpd: Bareword "HTML::Embperl::optDisableVarCleanup" not
> allowed while "strict subs" in use at
> /usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
> 123.
> Bareword "HTML::Embperl::optSendHttpHeader" not allowed while "strict
> subs" in use at
> /usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
> 124.
> Bareword "HTML::Embperl::dbgObjectSearch" not allowed while "strict
> subs" in use at
> /usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
> 163.
> Syntax error on line 145 of /etc/httpd/conf/httpd.conf:
> BEGIN not safe after errors--compilation aborted at
> /usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
> 250.
>
> [FAILED]
>
> The difference is error happens right after restarting the server.
>
> - Robert
>
> P.S. I should add this is apache-1.3.9/modperl-1.21 from RPM (the most
> recent RPM I know of), Embperl complains about modperl too old but it
> works (that's why I don't preload things - just to make sure).
>
Re: ANNOUNCE: HTML::Embperl 1.3b4 [ In reply to ]
Gerald Richter wrote:
>
> > > Does it change anything when you add a
> > >
> > > PerlModule HTML::EmbperlObject
> > >
>
> and
>
> PerlModule HTML::Embperl
> PerlModule HTML::EmbperlObject
>
> any changes?

Yes. Now Apache looks like it has started (start script says OK) but it
doesn't run at all and there's nothing in the logs I can find right
away. It smells of some ugly segfault I guess.

> I am about to leave to the conference. I hope I can get my email there.
> Since the tests runs ok, you may try to look at the test's httpd.conf
> (test/conf/httpd.conf and test/conf/startup.pl) and see what is different

I will look at it - if I find something I mail you tommorow. There may
be some difference in debug settings, perhaps. EmbperlObject with the
inheritance and the global variables seems to do exactly what I need, I
really want to play with it soon. Have fun at the conference.

- Robert
RE: ANNOUNCE: HTML::Embperl 1.3b4 [ In reply to ]
> PerlModule HTML::Embperl
> PerlModule HTML::EmbperlObject

I tried this.

> any changes?

It helps on two problems: Now Embperl 1.3b4 runs. And the problem I reported
earlier with Embperl sending a lot of angle brackets before the http header is
also gone.

Actually this release helped on a third problem - when I tried to use
MailFormTo it sent two copies of the email. Now it only sends one!

GrreaaAT!!

--
Kaare Rasmussen --Linux, spil,-- Tlf: 3816 2582
Kaki Data tshirts, merchandize Fax: 3816 2582
Howitzvej 75 Åben 14.00-18.00 Email: kar@webline.dk
2000 Frederiksberg Lørdag 11.00-17.00 Web: www.suse.dk
RE: ANNOUNCE: HTML::Embperl 1.3b4 [ In reply to ]
> Starting httpd: Bareword "HTML::Embperl::optDisableVarCleanup" not
> allowed while "strict subs" in use at
> /usr/lib/perl5/site_perl/5.005/i386-linux/HTML/EmbperlObject.pm line
> 123.
...
>
> P.S. I should add this is apache-1.3.9/modperl-1.21 from RPM (the most
> recent RPM I know of), Embperl complains about modperl too old but it
> works (that's why I don't preload things - just to make sure).
>

You are running on NT, right? or on Unix and mod_perl is build as DSO. In
both cases strange things will happen when using mod_perl 1.21 and preload
Embperl as I suggested. Instead of the two PerlModule directives, you may
try to put a & in front of all those constants in EmbperlObject.pm, where
Perl complains about.

I have to do some further investigation to see what's happeing there, but
maybe this helps until then.

Gerald