Embperl
view release on metacpan or search on metacpan
Changes.pod view on Meta::CPAN
- http headers from %http_headers_out will now also be send when the
init method of an application object return non zero (e.g. 302 for redirect).
- Updated xsl stylesheet and css styles of website for better display
of code sections.
- Updated db/epwebapp.pl to make it more robust and fix some minor bugs
and also allows to set edit and view_level (anonymous, login, admin)
for every table.
=head1 2.0rc5 7. August 2005
- Added attribute content-type to mail:send tag (Syntax Mail).
Patch from Axel Beckert.
- Added preloadfiles parameter to %initparam, which allows to
preload files in the parent process, when running under mod_perl.
See perldoc Config.pod for details.
- Fixed unresolved symbol when compiling under SuSE 9.3 (because SuSE
compiles Apache 2 in maintainer mode)
- Fixed strange output when Perl code inside of [$ sub $] returns
before any output.
- Fixed mail:send tag (Syntax Mail), so that Perl code inside the tag
for example to set an attribute, is now executed correctly.
Changes.pod view on Meta::CPAN
- Error messages will also be cached, so that the compiling of the code
only takes place once, because erroneous Perl code will cause memory
leaks in Perl itself if it's compiled on and on and on.
- Optimized the compiling of the embedded Perl code
- Changed use Apache::Constants to conform with the new default exports
introduced in mod_perl-1.07_01
- Output of the 'hidden' metacommand is sorted in the same order as the input
from the formfields (sorting order can also be supplied as third argument)
- <meta http-equiv= ... > will override the corresponding http header
(this keeps netscape from asking the user to reload the document
when the content-type differs between the http header and the
meta http-equiv)
This can also be used to set http headers
- Fixed a problem that Embperl magic variables do not work when
the package exists before the first call to Embperl
- Fixed a problem that caused a SIGSEGV when retrieving the same document
containing a Perl error for the second time from the same child
- Fixed a problem that caused Embperl to terminate in offline/cgi-mode
when the file was not found or when access was forbidden
- Fixed a problem with the 'hidden' metacommand, which came up when
Embperl.pod view on Meta::CPAN
=item B<TEXTAREA>, B</TEXTAREA>
The C<TEXTAREA> tag is treated exactly like other input fields.
=item B<META HTTP-EQUIV=>
<meta http-equiv= ... > will over-ride the corresponding http header.
This keeps Netscape from asking the user to reload the document
when the content-type differs between the http header and the
meta http-equiv.
This can also be used to set http headers. When running under mod_perl
http-headers can also be set by the function B<header_out>
Example of how to set a http header:
<META HTTP-EQUIV="Language" CONTENT="DE">
This is the same as using the Apache function
Embperl.pod view on Meta::CPAN
Perl carries for each string value a flag that tells if the string
is UTF-8 or not. Embperl uses this flag.
Posted form data is examined. If a string contains valid UTF-8
characters Perl's internal UTF-8 flag is set. You can disable
setting the UTF-8 flag by setting C<optFormDataNoUtf8> in C<EMBPERL_OPTIONS>.
Output escaping is done based on the UTF-8 flag. In case the UTF-8
flags is set characters above 127 are not escaped. To get the
correct appearance in your browser you also have to specify the
encoding as UTF-8 in your content-type http header.
If the UTF-8 flag is not set the output escaping is done based on the
setting of C<EMBPERL_OUTPUT_ESC_CHARSET>, which defaults to
ISO-8859-1 (latin1). ISO-8859-2 (latin2) is also selectable.
If you wish to have your Perl source code in UTF-8, you have to
add a C<use utf8;> at the top of each page.
Please note that not all modules sets Perl's internal UTF-8 flag
correctly. At the time of this writing for example
Embperl/Syntax/Mail.pm view on Meta::CPAN
# Definitions for Mail HTML tags
#
###################################################################################
sub Init
{
my ($self) = @_ ;
$self -> AddTagBlock ('mail:send', ['from', 'to', 'cc', 'bcc', 'subject', 'reply-to',
'mailhost', 'mailhelo', 'maildebug', 'content-type'],
undef, undef,
{
removenode => 106,
compiletimeperlcode => q{
$_ep_mail_opt_save = $Embperl::req->component->config->options ;
$Embperl::req->component->config->options (Embperl::Constant::optKeepSpaces | $_ep_mail_opt_save) ;
},
compiletimeperlcodeend => q{
$Embperl::req->component->config->options ($_ep_mail_opt_save) ;
},
Embperl/Syntax/Mail.pm view on Meta::CPAN
'syntax' => 'Text',
'from' => %&'from%,
'to' => %&'to%,
'cc' => %&'cc%,
'bcc' => %&'bcc%,
'subject' => %&'subject%,
'reply-to' => %&'reply-to%,
'mailhost' => %&'mailhost%,
'mailhelo' => %&'mailhelo%,
'maildebug' => %&'maildebug%,
'mailheaders' => [ (( %&'content-type% ) ? ('Content-Type: '.%&'content-type%) : ()) ],
}) ;
print STDERR join ('; ', @errors) if (@errors) ;
}
},
stackname => 'mail_send',
'push' => '%$x%',
},
) ;
}
Embperl/Syntax/Mail.pm view on Meta::CPAN
=item subject
=item reply-to
=item mailhost
=item mailhelo
=item maildebug
=item content-type
=back
On success it sets C<$?> to zero, otherwise to a value other then zero.
=head1 Author
Gerald Richter <richter at embperl dot org>
=head2 My HTML tags like '<' '>' and '"' are being translated to <, > !!!
Hey! Not you again!? I thought we already sent you to the
L<"Escaping & Unescaping"> section of the FAQ?!?! ;)
=head2 Netscape asks to reload the document
If you have something like this in your source, it may be the problem:
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=iso-8859-1">
Netscape seems to have a problem in such cases, because the http header is
only content-type text/html, while the META HTTP-EQUIV has an additional
charset specified. If you turn optEarlyHttpHeader off, Embperl will
automatically set the http header to be the same as the META HTTP-EQUIV.
=head2 I get "Stack underflow"
The problem often occurs, when you have a <table> tag in one file and a </table>
tag in another file and you both include them in a main page (e.g. as header
and footer). There are two workarounds for this problem:
eg/web/base.epl view on Meta::CPAN
[-
$r = shift ;
$http_headers_out{'content-type'} = 'text/html' ;
-]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Embperl
[$if @{$r -> {menuitems}} > 1 || $r -> {menuitems}[0]{menu} ne 'Home' $]
[- $i = 0 -]
[$foreach $item (@{$r -> {menuitems}}) $]
- [+ $r -> gettext($item -> {menu}) +]
while ((pEntry = hv_iternext (r -> pThread -> pHeaderHash)))
{
pKey = hv_iterkey (pEntry, &l) ;
pHeader = hv_iterval (r -> pThread -> pHeaderHash, pEntry) ;
loc = 0;
if (pHeader && pKey)
{
if (stricmp (pKey, "location") == 0)
loc = 1;
if (stricmp (pKey, "content-type") == 0)
{
p = NULL;
if ( SvROK(pHeader) && SvTYPE(SvRV(pHeader)) == SVt_PVAV )
{
arr = (AV *)SvRV(pHeader);
if (av_len(arr) >= 0)
{
svp = av_fetch(arr, 0, 0);
p = SvPV(*svp, ldummy);
}
oputs (r, "\n") ;
if (r -> Component.Config.bDebug & dbgHeadersIn)
lprintf (r -> pApp, "[%d]HDR: %s: %s\n", r -> pThread -> nPid, pKey, p) ;
if (loc == 1)
break;
}
}
else
{
p = SvPV (pHeader, na) ;
if (stricmp (pKey, "content-type") == 0)
pContentType = p ;
else
{
oputs (r, pKey) ;
oputs (r, ": ") ;
oputs (r, p) ;
oputs (r, "\n") ;
}
if (r -> Component.Config.bDebug & dbgHeadersIn)
lprintf (r -> pApp, "[%d]HDR: %s: %s\n", r -> pThread -> nPid, pKey, p) ;
( run in 0.651 second using v1.01-cache-2.11-cpan-d7f47b0818f )