<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Embedded perl - Revision history</title>
		<link>https://www.slackwiki.com/index.php?title=Embedded_perl&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.40.0</generator>
		<lastBuildDate>Wed, 08 Apr 2026 02:55:18 GMT</lastBuildDate>
		<item>
			<title>Erik: Copy from old, had no category, placed in Tutorials</title>
			<link>https://www.slackwiki.com/index.php?title=Embedded_perl&amp;diff=111&amp;oldid=prev</link>
			<guid isPermaLink="false">https://www.slackwiki.com/index.php?title=Embedded_perl&amp;diff=111&amp;oldid=prev</guid>
			<description>&lt;p&gt;Copy from old, had no category, placed in Tutorials&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Tutorials]]&lt;br /&gt;
==How to Install Embedded Perl on Slackware 12.0==&lt;br /&gt;
&lt;br /&gt;
First, I installed mod_perl: [[mod_perl|Installing Mod_Perl]].&lt;br /&gt;
&lt;br /&gt;
Then, I used [[cpan|cpan]] to install Embed Perl.  I ran &amp;quot;perl -MCPAN -e shell&amp;quot; and at the prompt typed &amp;quot;install Embperl&amp;quot;.  This prompted me for some dependencies, I had to do &amp;quot;install LWP&amp;quot; and then try &amp;quot;install Embperl&amp;quot; again.  Eventually it worked.&lt;br /&gt;
&lt;br /&gt;
I added these lines to the section for my virtual host in /etc/httpd/extra/httpd-vhost.conf (they could also be added in the main httpd.conf to apply to the whole server if desired):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#    PerlModule HTML::Embperl&lt;br /&gt;
    PerlModule Embperl&lt;br /&gt;
    &amp;lt;Directory /home/rgr/public_html/embperl&amp;gt;&lt;br /&gt;
        SetHandler perl-script&lt;br /&gt;
        Options ExecCGI&lt;br /&gt;
#       PerlHandler HTML::Embperl::handler&lt;br /&gt;
        PerlHandler Embperl::handler&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note the parts that are commented out -- whose were in an online example I found, but they resulted in the &amp;quot;500 internal server error&amp;quot; message.  I could see the detailed message in the apache error log, and perl was looking for HTML/Embperl.pm when it should have been looking for Embperl.pm.&lt;br /&gt;
&lt;br /&gt;
After that I set up an example file (see the tutorial below) and successfully tested it.&lt;br /&gt;
&lt;br /&gt;
==Tutorial on Use==&lt;br /&gt;
&lt;br /&gt;
http://perl.apache.org/embperl/pod/intro/Intro.-page-3-.htm&lt;br /&gt;
&lt;br /&gt;
Here is an example file I created in /home/rgr/public_html/embperl/test.pl (it actually should be in which ever directory you set to be handled via embperl in the httpd.conf file or httpd-vhosts.conf file):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
First line.&amp;lt;br&amp;gt;&lt;br /&gt;
[- $a = 5 -] Some stuff! [- $b = 6 if ($a == 5) -]&amp;lt;br&amp;gt;&lt;br /&gt;
Now for some output:&amp;lt;br&amp;gt;&lt;br /&gt;
[+ $a +]  [+ $array[$b] +] [+ &amp;quot;A is $a&amp;quot; +]&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here is the output of http://localhost/embperl/test.html:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
First line.&lt;br /&gt;
Some stuff!&lt;br /&gt;
Now for some output:&lt;br /&gt;
5 A is 5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the code with [-  -] is just run.  The code with [+  +] is run, and the results are used to replace that part of the html file.  You can also use [!  !] which is for code that should only be run once, such as function definitions.  The perldoc documentation or the apache page linked above has more complete explanations and tutorials: &lt;br /&gt;
http://perl.apache.org/embperl/&lt;/div&gt;</description>
			<pubDate>Wed, 03 Jun 2009 02:15:10 GMT</pubDate>
			<dc:creator>Erik</dc:creator>
			<comments>https://www.slackwiki.com/Talk:Embedded_perl</comments>
		</item>
</channel></rss>