Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 2846c2b6fe3a964eff4f3b3c12eee018 > files > 452

apache-HTML-Embperl-2.2.0-8mdv2010.0.i586.rpm

<html>
<head>
<title>Tests for Embperl - Embperl sub Metacommand</title>
</head>


<body>

[###### first sub #####]
[$sub txt$]
*txt* 
*txt* <h2>Here goes some normal html text <h2>
*txt* 
[$endsub$]


[###### second sub #####]
[$sub perl_code $]
*perl_code* 
*perl_code* Here comes some perl:
*perl_code* 
*perl_code* [- $foo = 'Hello world' -]
*perl_code* 
*perl_code* foo = [+ $foo +]<br>
*perl_code* testdata = [+ $testdata +]<br>
*perl_code* 
[$endsub$]

[###### main page #####]


<h1>Tests for Embperl - Embperl sub Metacommand</h1>

[- $testdata = 'abcd' -]

Now we call the first sub via Execute:

[- Execute ('#txt') -]

And now the second via Execute:

[- Execute ('#perl_code') -]

Now we call the first sub via Perl:

[- txt -]

And now the second via Perl:

[- perl_code -]

-> Second time, other order:

And now the second via Perl:

[- perl_code -]

Now we call the first sub via Perl:

[- txt -]

-> And Execute again, but other order

And now the second via Execute:

[- Execute ('#perl_code') -]

Now we call the first sub via Execute:

[- Execute ('#txt') -]



And done!



</body>
</html>