HTML-Embperl

 view release on metacpan or  search on metacpan

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;').

EmbperlD.pod  view on Meta::CPAN

gesetzt werden.

Beispiel:

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

Das entspricht der Apachefunktion:

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

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

Die Ausgaben von Perlblöcken innerhalb des C<HREF> Attributes des C<A> Tags und des
C<SRC> Attributes der anderen Tags werden URL Kodiert, statt HTML Kodiert.
(siehe auch L<$escmode>). Des weiteren expandiert I<Embperl> Array- und Hashreferenzen
innerhalb solcher URLs zur URL Parametersyntax. Beispiel:

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

EmbperlD.pod  view on Meta::CPAN

=over 4

=item B<$escmode = 8 (oder 15)> (2.0b4 und höher)

Das Resultat von Perlausdrücken wird immer XML Kodiert 
(z.B. '>' wird zu '&gt;' und ' zu &apos;).

=item $escmode = 3 (oder 7)

Das Resultat von Perlausdrücken wird HTML Kodiert (z.B. '>' wird zu '&gt;')
und URL Kodiert ('&' wird zu '%26') innerhalb von C<A>, C<EMBED>, C<IMG>, C<IFRAME>, C<FRAME> und C<LAYER> Tags.

=item $escmode = 2 (oder 6)

Das Resultat von Perlausdrücken wird immer URL Kodiert ('&' wird zu '%26').

=item $escmode = 1 (oder 5)

Das Resultat von Perlausdrücken wird immer HTML Kodiert (z.B. '>' wird zu '&gt;').

=item $escmode = 0

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|\"12\")>x<\/A>
^A Tag 12b\:  <A HREF=(12b|\"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">
Array in A <a href="http://localhost/tests?X=9&amp;Y=8&amp;Z=7">

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

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 1.951 second using v1.01-cache-2.11-cpan-71847e10f99 )