"David M. Spreitzer" wrote:
>
> I'm a Embperl newbie needing some help.
>
> I've implementing EmbperlObject for generating the html pages, which btw
> worked great. Now I'd like to use the component files (headers/footers)
> within some existing cgi scripts. I think HTML::EmbperlObject::Execute
> is my answer, but I'm having some trouble implementing this
> functionality.
>
> 1) is this possible and is EmbperlObject::Execute really what I'm
> looking for?
>
> 2) given the following, am I missing/over-looking anything, or just
> doing it wrong.
>
> 3) the log file shows it finds and does some processing on the
> components, but not output is generated on the browser.
>
> 4) Can the log output be piped to a another program, like Apache
> CustomLog pipe directive.
>
> using Apache/1.3.17 (solaris)
> mod_perl/1.25
> Embperl 1.3.1
>
> http config file entry:
> (Some EMBPERL entries are probably not need, but I included them anyway)
> <Files *.epl>
> PerlSetEnv EMBPERL_OBJECT_BASE base.ep
> PerlSetEnv EMBPERL_FILESMATCH "\.epl"
> PerlSetEnv EMBPERL_DECLINE "\.ep"
> PerlSetEnv EMBPERL_OBJECT_ADDPATH /web/apache/embperl
> PerlSetEnv EMBPERL_OBJECT_FALLBACK missing_handler.embperl
>
> PerlSetEnv EMBPERL_DEBUG 30
>
> PerlSendHeader On
> SetHandler perl-script
> PerlHandler Apache::Registry
> Options +ExecCGI
> </Files>
>
> cgi script:
> #!/usr/local/bin/perl
>
> use strict;
> require CGI;
> CGI->import(qw(:standard :html3 font));
>
> use HTML::EmbperlObject;
>
> main();
>
> sub main {
> print header(),start_html();
>
> # my $Logfile = '|/usr/local/sbin/cronolog
> /usr/local/apache/logs/%Y/%m/%d/embperl_log';
> my $Logfile = '/tmp/embperl_log_test';
> my $DebugDefault = 2285;
> HTML::Embperl::Init ($Logfile, $DebugDefault);
> HTML::Embperl::ScanEnvironment;
>
> HTML::EmbperlObject::Execute ({inputfile => 'table.ep'});
> HTML::EmbperlObject::Execute ({inputfile => 'title.ep'});
>
> print end_html();
> }
>
> file table.ep:
> [- @link = (
> "1",
> "2"
> ) -]
>
> [- @name = (
> "1",
> "2"
> ) -]
>
> start table
> [- $i = 0 -]
> <table border=0 cellpadding=3 cellspacing=0 width=100%>
> [$ do $]
> <tr><td>
> <table border=0 cellpadding=1 cellspacing=0 width=100%
> bgcolor=#6699cc> <tr><td>
> <table border=0 cellpadding=5 cellspacing=0 width=100%
> bgcolor=#e7effa> <tr><td>
> <a href=[+ $link[ $i ] +]><b>[+ $name[ $i ] +]</b></a>
> </td></tr> </table>
> </td></tr> </table>
> </td></tr>
> [- $i++ -]
> [$ until $i > $#link $]
> </table>
> end table
>
> file title.ep:
> <h2>
> [- @time = split /[\s:]/, localtime; -]
> [$ if ( $time[3] < 12 ) $]
> Good morning
> [$ elsif ( $time[3] < 17 ) $]
> Good afternoon
> [$ else $]
> Good evening
> [$ endif $]
> </h2>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
You might want to check EmbperlObj docs:
http://perl.apache.org/embperl/EmbperlObject.pod.cont.html
Dimitri Ostapenko
Perl/Internet
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]