The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

<html>
<head>
<title>Embperl Tests - Include other Embperl pages via Execute</title>
</head>

<h1>Embperl Tests - Include other Embperl pages via Execute</h1>


<H1> 1.) Include from memory</H1>

<P>Here is some text</P>
<H1> 2.) Include from memory with some Embperl code</H1>

<table><tr><td>a1</td> <td>b2</td> <td>c3</td> </tr> </table> </P>
<H1> 3.) Include from memory with passing of variables</H1>


<P>Transfer some vars Some Var !</P>
<H1> 4.) Change the variable, but not the code</H1>

<P>Transfer some vars Do it again !</P>
<H1> 5a.) Use  method -> param to pass parameters</H1>


<P>Use method -> param to transfer some data (1 2 3 4) !</P>
<H1> 5.) Use \@param to pass parameters</H1>


<P>Use @param to transfer some data (1 2 3 4) !</P>
<H1> 6.) Use \@param to pass parameters and return it</H1>

<H3> $p[0] is vara and $p[1] is varb<H3>

<P>Got data in @param (vara varb) !</P><P>Change data in @param to (newA newB) !</P>
<H3> $p[0] is now newA and $p[1] is now newB <H3>

<H1> 7.) Presetup \%fdat and \@ffld</H1>

<P><table><tr><td>fdat</td><td>text</td></tr><tr><td>test</td><td>value</td></tr></table></P>
<H1> 7a.) Presetup my \%fdat and my \@ffld</H1>

<P><table><tr><td>fdat1</td><td>text1</td></tr><tr><td>test1</td><td>value1</td></tr></table></P>
<H1> 7b.) Presetup \%fdat</H1>

^<P><table><tr><td>(fdat2<\/td><td>text2<\/td><\/tr><tr><td>test2<\/td><td>value2|test2<\/td><td>value2<\/td><\/tr><tr><td>fdat2<\/td><td>text2)<\/td><\/tr><\/table><\/P>
<H1> 7c.) Presetup  \@ffld</H1>

<P><table></table></P> @ffld = fdat3 test3
<H1> 8a.) Include a file</H1>


Here it starts with some HTML Text<P>

All values should be undefined at the first include and
apear at the second include:
<P>

$a =  <BR>
$b =  <BR>
$c =  <BR>
$d =  <BR>
$e =  <BR>


First of all assign a value:
<BR>

Now we have some 'Umlaute':


Now lets look what we are getting from this:<BR>
(this is the value in $a) (this is the value in $a) &auml;&ouml;&uuml;<BR>

And now a and b together: (this is the value in $a)(this is the value in $a) &auml;&ouml;&uuml;<P>

Here we have some HTML tags within the perl code, Embperl will delete them!<BR>

57
SELECT *  FROM a ORDER BY b USING &lt;; Hi There&gt;
Here we have something which looks like a HTML tag, but does not start with<br>
a character, Embperl does not change them!<BR>

SELECT * FROM a ORDER BY b USING &lt;; Hi There&gt;
Embperl will also translate HMTL escapes to the right characters i.e. $a &amp;lt; 6 will get the perl expression $a &lt; 6: <BR>

1
Now they should have a value

$a = (this is the value in $a) <BR>
$b = (this is the value in $a) &auml;&ouml;&uuml; <BR>
$c = 57 <BR>
$d = 1 <BR>
$e = 2 <BR>

<P>Ok.<P>


<H1> 8b.) Include again the same file </H1> 
 

Here it starts with some HTML Text<P>

All values should be undefined at the first include and
apear at the second include:
<P>

$a = (this is the value in $a) <BR>
$b = (this is the value in $a) &auml;&ouml;&uuml; <BR>
$c = 57 <BR>
$d = 1 <BR>
$e = 2 <BR>


First of all assign a value:
<BR>

Now we have some 'Umlaute':


Now lets look what we are getting from this:<BR>
(this is the value in $a) (this is the value in $a) &auml;&ouml;&uuml;<BR>

And now a and b together: (this is the value in $a)(this is the value in $a) &auml;&ouml;&uuml;<P>

Here we have some HTML tags within the perl code, Embperl will delete them!<BR>

57
SELECT *  FROM a ORDER BY b USING &lt;; Hi There&gt;
Here we have something which looks like a HTML tag, but does not start with<br>
a character, Embperl does not change them!<BR>

SELECT * FROM a ORDER BY b USING &lt;; Hi There&gt;
Embperl will also translate HMTL escapes to the right characters i.e. $a &amp;lt; 6 will get the perl expression $a &lt; 6: <BR>

1
Now they should have a value

$a = (this is the value in $a) <BR>
$b = (this is the value in $a) &auml;&ouml;&uuml; <BR>
$c = 57 <BR>
$d = 1 <BR>
$e = 2 <BR>

<P>Ok.<P>


<H1> 9.) Include a file and return output in a scalar</H1>



<H3> 
Here it starts with some HTML Text&lt;P&gt;

All values should be undefined at the first include and
apear at the second include:
&lt;P&gt;

$a = (this is the value in $a) &lt;BR&gt;
$b = (this is the value in $a) &amp;auml;&amp;ouml;&amp;uuml; &lt;BR&gt;
$c = 57 &lt;BR&gt;
$d = 1 &lt;BR&gt;
$e = 2 &lt;BR&gt;


First of all assign a value:
&lt;BR&gt;

Now we have some 'Umlaute':


Now lets look what we are getting from this:&lt;BR&gt;
(this is the value in $a) (this is the value in $a) &amp;auml;&amp;ouml;&amp;uuml;&lt;BR&gt;

And now a and b together: (this is the value in $a)(this is the value in $a) &amp;auml;&amp;ouml;&amp;uuml;&lt;P&gt;

Here we have some HTML tags within the perl code, Embperl will delete them!&lt;BR&gt;

57
SELECT *  FROM a ORDER BY b USING &amp;lt;; Hi There&amp;gt;
Here we have something which looks like a HTML tag, but does not start with&lt;br&gt;
a character, Embperl does not change them!&lt;BR&gt;

SELECT * FROM a ORDER BY b USING &amp;lt;; Hi There&amp;gt;
Embperl will also translate HMTL escapes to the right characters i.e. $a &amp;amp;lt; 6 will get the perl expression $a &amp;lt; 6: &lt;BR&gt;

1
Now they should have a value

$a = (this is the value in $a) &lt;BR&gt;
$b = (this is the value in $a) &amp;auml;&amp;ouml;&amp;uuml; &lt;BR&gt;
$c = 57 &lt;BR&gt;
$d = 1 &lt;BR&gt;
$e = 2 &lt;BR&gt;

&lt;P&gt;Ok.&lt;P&gt;


 </H3>


<H1> 10.) Include inside a table</H1>

<table>
    <tr>
	<td>
	    m1 : Start include
<table>
    <tr>
	<td>
	    m1 - s1	</td>
    
	<td>
	    m1 - s2	</td>
    
	<td>
	    m1 - s3	</td>
    </tr>
</table>
Parameters:<BR>
<table>
    <tr>
	<td>
	    m1	</td>
    
	<td>
	    main	</td>
    </tr>
</table>
p0	    m1
p1	    main
End include

</td>
    </tr>

    <tr>
	<td>
	    m2 : Start include
<table>
    <tr>
	<td>
	    m2 - s1	</td>
    
	<td>
	    m2 - s2	</td>
    
	<td>
	    m2 - s3	</td>
    </tr>
</table>
Parameters:<BR>
<table>
    <tr>
	<td>
	    m2	</td>
    
	<td>
	    main	</td>
    </tr>
</table>
p0	    m2
p1	    main
End include

</td>
    </tr>

    <tr>
	<td>
	    m3 : Start include
<table>
    <tr>
	<td>
	    m3 - s1	</td>
    
	<td>
	    m3 - s2	</td>
    
	<td>
	    m3 - s3	</td>
    </tr>
</table>
Parameters:<BR>
<table>
    <tr>
	<td>
	    m3	</td>
    
	<td>
	    main	</td>
    </tr>
</table>
p0	    m3
p1	    main
End include

</td>
    </tr>
</table>


<H1> 11.) Include a file with parameters</H1>

Here is param[0] -> 0<br>
Here is param[1] -> B<br>
Here is param[2] -> three<br>
Here is param[3] -> dddd<br>
Here is param[4] -> 555<br>



<H1> 12.) Include a file and write outputfile</H1>

<H1> 12.) Done :-)</H1>

<br>


<p><hr>

<small>Embperl (c) 1997-2005 G.Richter</small>

</body>
</html>