## The test of HTML::EmbeddedPerl(BETA)

(source-code is visible green)

> use vars qw($qqq @xxx %zzz $flg); $qqq = "OK."; #13 no strict; no warnings;

> /*
> comment 18
> comment 19
> comment 20
> comment 21
> comment 22
> comment 23
> comment 24
> comment 25
> comment 26
> */
> foreach(sort keys %ENV){ //28
> print STDOUT "$_: $ENV{$_}<br />\n"; //29
> } //30

DOCUMENT_ROOT: /valore/serv/twintk/www
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: text/html, image/jpeg, image/png, text/*, image/*, */*
HTTP_ACCEPT_CHARSET: utf-8, utf-8;q=0.5, *;q=0.5
HTTP_ACCEPT_ENCODING: x-gzip, x-deflate, gzip, deflate
HTTP_ACCEPT_LANGUAGE: ja, en
HTTP_HOST: www.twinkle.tk
HTTP_REFERER: http://www.twinkle.tk/tests/embedding-perl/
HTTP_USER_AGENT: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko)
HTTP_X_FORWARDED_FOR: 192.168.10.10, 192.168.1.2
PATH: /usr/local/bin:/usr/bin:/bin
QUERY_STRING:
REMOTE_ADDR: 192.168.1.2
REMOTE_HOST: starunit.myserv.noo
REMOTE_PORT: 46804
REQUEST_METHOD: GET
REQUEST_URI: http://www.twinkle.tk/tests/embedding-perl/usinginthescript.cgi
SCRIPT_FILENAME: /valore/serv/twintk/www/tests/embedding-perl/usinginthescript.cgi
SCRIPT_NAME: /tests/embedding-perl/usinginthescript.cgi
SERVER_ADDR: 192.168.1.2
SERVER_ADMIN: webmaster@twinkle.tk
SERVER_NAME: www.twinkle.tk
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.0
SERVER_SIGNATURE:
SERVER_SOFTWARE: Apache/2.2.11 (Mandriva Linux/PREFORK-10.10mdv2009.1) mod_python/3.3.1 Python/2.6.1 mod_ruby/1.2.6 Ruby/1.8.7(2008-08-11) mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.2.14 with Suhosin-Patch mod_mono/2.2 mod_jk/1.2.30 mod_perl/2.0.4 Perl/v5.10.0
UNIQUE_ID: TKikcX8AAAEAAFuuR0AAAAAE

> $ep->print(<<__EOP__);
> /* comments 36 */<br />
> // comments 37<br />
> # comments 38<br />
> __EOP__ /*39*/

/* comments 36 */
// comments 37
# comments 38

> $ep->print("# $qqq"); #44

# OK.

$qqq = OK.

> @xxx = ("a".."c"); #50

> <@=xxx><p>$_</p>\n</@>

a

b

c

@xxx = a b c

> %zzz = ("a"=>[1,2,3],"b"=>[4,5,6]); #58

> <%=zzz><tr><th>$k</th><@={v}><td>$_</td></@></tr>\n</%>

a | 1 | 2 | 3
b | 4 | 5 | 6

@{$zzz{a}} = 1 2 3

@{$zzz{b}} = 4 5 6

> $flg = 1; print "# not comment<br />\n"; # 69

# not comment

> <!=$flg><p>1</p><!=!$flg><p>0</p><!><p>?</p></!>

1

> $ep->print(ref($ep)); #74

HTML::EmbeddedPerl

> $ep->print(ref($ev)); #78

HTML::EmbeddedPerl::Vars

define subroutine.

> sub test_print{ $ep->print('OK.'); }; //83

> &test_print; /* 87 */

OK.

> $ep->print('test'); //91

test

> $ep->header_out('Content-Create','foo'); /* 93 */

Apache/2.2.11 (Mandriva Linux/PREFORK-10.10mdv2009.1) mod_python/3.3.1 Python/2.6.1 mod_ruby/1.2.6 Ruby/1.8.7(2008-08-11) mod_ssl/2.2.11 OpenSSL/0.9.8k PHP/5.2.14 with Suhosin-Patch mod_mono/2.2 mod_jk/1.2.30 mod_perl/2.0.4 Perl/v5.10.0