Embperl

 view release on metacpan or  search on metacpan

Config.pod  view on Meta::CPAN


=item escXML = 8 (or 15) (2.0b4 and above)

The result of a Perl expression is always XML-escaped (e.g., `>'
becomes `>' and ' become ').

=item escUrl + escHtml = 3 (or 7)

The result of a Perl expression is HTML-escaped (e.g., `>' becomes
`>') in normal text and URL-escaped (e.g., `&' becomes `%26')
within of C<A>, C<EMBED>, C<IMG>, C<IFRAME>, C<FRAME> and C<LAYER> tags.

=item escUrl = 2 (or 6)

The result of a Perl expression is always URL-escaped (e.g., `&'
becomes `%26').

=item escHtml = 1 (or 5)

The result of a Perl expression is always HTML-escaped (e.g., `>'
becomes `&gt;').

Embperl.pod  view on Meta::CPAN


    Example of how to set a http header:

    <META HTTP-EQUIV="Language" CONTENT="DE">

    This is the same as using the Apache function

    [- $req_rec -> header_out("Language" => "DE"); -]


=item B<A>, B<EMBED>, B<IMG>, B<IFRAME>, B<FRAME>, B<LAYER>

The output of perl blocks inside the C<HREF> attribute of the C<A> Tags and the
C<SRC> attribute of the other Tags are URL escaped instead of HTML escaped.
(see also L<$escmode>). Also, when inside such a URL, I<Embperl> expands array and hash references
to URL parameter syntax. Example:

  [-
  $A = { A => 1, B => 2 } ;  # Hashreference
  @A = (X, 9, Y, 8, Z, 7)
  -]

Embperl.pod  view on Meta::CPAN


=item B<$escmode = 8 (or 15)> (2.0b4 and above)

The result of a Perl expression is always XML-escaped (e.g., `>'
becomes `&gt;' and ' become &apos;).

=item B<$escmode = 3 (or 7)>

The result of a Perl expression is HTML-escaped (e.g., `>' becomes
`&gt;') in normal text and URL-escaped (e.g., `&' becomes `%26')
within of C<A>, C<EMBED>, C<IMG>, C<IFRAME>, C<FRAME> and C<LAYER> tags.

=item B<$escmode = 2 (or 6)>

The result of a Perl expression is always URL-escaped (e.g., `&'
becomes `%26').

=item B<$escmode = 1 (or 5)>

The result of a Perl expression is always HTML-escaped (e.g., `>'
becomes `&gt;').

test/cmp/escape.htm  view on Meta::CPAN

A Tag 8:   <a TARGET=8  href="8">x</A>
A Tag 9:   <a href="9"  TARGET="9">x</A>
A Tag 10:  <a TARGET="10" href="10"  TARGET="10">x</A>
A Tag 11:  <a href="11">x</A>
A Tag 12:  <a href="12">x</A>
A Tag 12b: <a href="12b">x</A>
A Tag 13:  <a href="abcd%20%3E">x</A>
A Tag 14:  <a href="abcd%20%3E">x</A>
FRAME:	   <frame src="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"   name="%20foo">
IFRAME:    <iframe src="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"  name="%20foo">
EMBED:     <embed src="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"   name="%20foo">
LAYER:	   <layer src="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"   name="%20foo">
IMG:	   <img src="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"     name="%20foo">
FORM:	   <form action="http://localhost/tests?id=abcdefghijklmnopqrstuvwxyz&text=This%20is%20a%20text%20%3F%20%26%20%2B%20-%20%2521"     name="%20foo">

^Hash in  A <a href=\"http:\/\/localhost\/tests\?(A=1\&amp;B=2|B=2\&amp;A=1)\">
^Array in A <a href=\"http:\/\/localhost\/tests\?(X=9|Y=8|Z=7)\&amp;(X=9|Y=8|Z=7)\&amp;(X=9|Y=8|Z=7)\">

^Hash in  H <a href=\"http:\/\/localhost\/tests\?(A=1\&amp;B=2|B=2\&amp;A=1)\">
^Array in H <a href=\"http\:\/\/localhost\/tests\?(X=9|Y=8|Z=7)\&amp;(X=9|Y=8|Z=7)\&amp;(X=9|Y=8|Z=7)\">

test/html/escape.htm  view on Meta::CPAN

A Tag 8:   <A TARGET=8 HREF="8">x</A>
A Tag 9:   <A HREF="9" TARGET="9">x</A>
A Tag 10:  <A TARGET="10" HREF="10" TARGET="10">x</A>
A Tag 11:  <A  HREF="11"  >x</A>
A Tag 12:  <A HREF=12>x</A>
A Tag 12b: <A HREF=12b >x</A>
A Tag 13:  <A HREF="[+ "abcd"+]%20[+ "%3e" +]">x</A>
A Tag 14:  <A HREF="[+ "abcd"+]%20[+ "&gt;" +]">x</A>
FRAME:	   <FRAME SRC="http://localhost/tests?id=[+%20$id +]&text=[+$text+]"  name="%20foo">
IFRAME:    <IFRAME SRC="http://localhost/tests?id=[+%20$id +]&text=[+$text+]" name="%20foo">
EMBED:     <EMBED SRC="http://localhost/tests?id=[+%20$id +]&text=[+$text+]"  name="%20foo">
LAYER:	   <LAYER SRC="http://localhost/tests?id=[+%20$id +]&text=[+$text+]"  name="%20foo">
IMG:	   <IMG SRC="http://localhost/tests?id=[+%20$id +]&text=[+$text+]"    name="%20foo">
FORM:	   <FORM action="http://localhost/tests?id=[+%20$id +]&text=[+$text+]"    name="%20foo">

[- %A = (A => 1, B => 2) ; @A = (X, 9, Y, 8, Z, 7) -]
Hash in  A <A HREF="http://localhost/tests?[+ [ %A ] +]">
Array in A <A HREF="http://localhost/tests?[+ \@A +]">

[- %H = (A => 1, B => 2) ; @H = (X, 9, Y, 8, Z, 7) -]
Hash in  H <A HREF="http://localhost/tests?[+ \\%H +]">



( run in 0.622 second using v1.01-cache-2.11-cpan-71847e10f99 )