You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by ri...@hyperreal.org on 1999/05/07 22:24:55 UTC

cvs commit: modperl-site/embperl Changes.pod.1.html Faq.pod.1.html Faq.pod.2.html Faq.pod.3.html Faq.pod.4.html Faq.pod.5.html Faq.pod.6.html Faq.pod.7.html Faq.pod.cont.html

richter     99/05/07 13:24:55

  Modified:    embperl  Changes.pod.1.html Faq.pod.1.html Faq.pod.2.html
                        Faq.pod.3.html Faq.pod.4.html Faq.pod.5.html
                        Faq.pod.6.html Faq.pod.7.html Faq.pod.cont.html
  Log:
  Embperl Webpages - Changes
  
  Revision  Changes    Path
  1.55      +8 -2      modperl-site/embperl/Changes.pod.1.html
  
  Index: Changes.pod.1.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Changes.pod.1.html,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- Changes.pod.1.html	1999/05/03 19:45:09	1.54
  +++ Changes.pod.1.html	1999/05/07 20:24:51	1.55
  @@ -18,7 +18,7 @@
     <blockquote>
   [<a href="index.html">HOME</a>]&nbsp;&nbsp; [<a href="Changes.pod.cont.html">CONTENT</a>]&nbsp;&nbsp; [<a href="Changes.pod.cont.html">PREV (Revision History - Content)</a>]&nbsp;&nbsp; [<a href="Changes.pod.2.html">NEXT (1.2b4 (BETA)  15 Feb 1999)</a>]&nbsp;&nbsp; <br><hr>
   <P>
  -Last Update: Mon May 3 21:46:08 1999 (MET)
  +Last Update: Fri May 7 22:25:47 1999 (MET)
   
   <P>
   NOTE: This version is only available via <A HREF="CVS.pod.1.html#INTRO">"CVS"</A>
  @@ -48,16 +48,22 @@
      - Added epchar.c.iso-latin-2 from Jiri Novak, which contains the correct
        escaping for the iso-8859-2 (iso-latin-2) character set. You may use it
        to replace the standard epchar.c
  -   - Added new metacommand [$ macro &lt;name&gt; $] and [$ endmacro $] which allows
  +   - Added new metacommand [$ sub &lt;name&gt; $] and [$ endsub $] which allows
        you to define blocks of code an call them mulitple times inside a page,
        either a creating a subrequest Execute('#&lt;name&gt;') or by calling them
        directly as a perl subroutine [- &lt;name&gt; -]. Read the docs for more
        information on the details and differences.
  +   - Added new parameter &quot;import&quot; to Execute, which let's you import subs
  +     (defined with [$sub &lt;name&gt;$]) into the current page.
      - @ffld is filled with 'values %fdat' if the ffld parameter in the call
        to the Execute funtion is missing.
      - Filedata will held into memory until the end of the request, so a
        second call to Execute for the same file will not reread the data
        from disk.
  +   - Added emacs/embperl.el. It's a emacs minor mode for Embperl written
  +     by Erik Arneson
  +   - Output of dbgShowCleanup is now sorted by name
  +   - Update the Faq.pod with new Q&amp;A and removed obsolete Q&amp;A
   </PRE>
   <p>[<a href="index.html">HOME</a>]&nbsp;&nbsp; [<a href="Changes.pod.cont.html">CONTENT</a>]&nbsp;&nbsp; [<a href="Changes.pod.cont.html">PREV (Revision History - Content)</a>]&nbsp;&nbsp; [<a href="Changes.pod.2.html">NEXT (1.2b4 (BETA)  15 Feb 1999)</a>]&nbsp;&nbsp; <br>
       <font color="#808080">___________________________________________________________________________________<br>
  
  
  
  1.5       +135 -5    modperl-site/embperl/Faq.pod.1.html
  
  Index: Faq.pod.1.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Faq.pod.1.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Faq.pod.1.html	1999/02/15 12:34:08	1.4
  +++ Faq.pod.1.html	1999/05/07 20:24:52	1.5
  @@ -18,7 +18,7 @@
     <blockquote>
   [<a href="index.html">HOME</a>]&nbsp;&nbsp; [<a href="Faq.pod.cont.html">CONTENT</a>]&nbsp;&nbsp; [<a href="Faq.pod.cont.html">PREV (FAQ - Content)</a>]&nbsp;&nbsp; [<a href="Faq.pod.2.html">NEXT (Common Problems)</a>]&nbsp;&nbsp; <br>	<UL>
   
  -		<LI><A href="Faq.pod.1.html#Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl?</A>
  +		<LI><A href="Faq.pod.1.html#Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl for Unix?</A>
   		<LI><A href="Faq.pod.1.html#Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl for Win32?</A>
   		<LI><A href="Faq.pod.1.html#I_want_to_run_Embperl_with_mod_p">I want to run Embperl with mod_perl under Apache. In what order should I</A>
   		<LI><A href="Faq.pod.1.html#I_m_getting_">I'm getting:</A>
  @@ -27,16 +27,24 @@
   		<LI><A href="Faq.pod.1.html#Running_make_test_fails_with_a">Running 'make test' fails with an error message at loading of Embperl </A>
   		<LI><A href="Faq.pod.1.html#How_can_I_build_a_statically_lin">How can I build a statically-linked copy of Embperl with mod_perl </A>
   		<LI><A href="Faq.pod.1.html#How_do_I_load_Embperl_at_server_">How do I load Embperl at server startup?</A>
  +		<LI><A href="Faq.pod.1.html#make_test_fails_with_a_SIGxxxx_">make test fails with a SIGxxxx, how can I obtain a stack bactrace</A>
  +		<LI><A href="Faq.pod.1.html#How_do_I_build_Embperl_with_debu">How do I build Embperl with debugging informations</A>
  +		<LI><A href="Faq.pod.1.html#make_test_fails_with_SIGXFSZ">make test fails with SIGXFSZ</A>
  +		<LI><A href="Faq.pod.1.html#Embperl_on_SCO_Unix">Embperl on SCO Unix</A>
  +		<LI><A href="Faq.pod.1.html#Embperl_does_not_write_to_the_lo">Embperl does not write to the logfile, because of missing permissions</A>
   	</UL>
   <hr>
   <P>
   For basics on downloading, compiling, and installing, please see the 
   <A HREF="INSTALL.pod.1.html#INSTALLATION">INSTALLATION</A> in the Embperl documentation. Please be sure to load Embperl at server
  -startup - if you do not, various problems may result. 
  +startup - if you do not, various problems may result. An exception to that
  +rule is when you have compiled mod_perl with
  +<STRONG>USE_DSO</STRONG>. In this case you <STRONG>must not</STRONG> load Embperl at server statup, neither via an use in your startup.pl file,
  +nor via PerlModule from your httpd.conf.
   
   <P>
   <HR>
  -<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl?</A></H2>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl for Unix?</A></H2>
   <P>
   No.
   
  @@ -44,8 +52,10 @@
   <HR>
   <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl for Win32?</A></H2>
   <P>
  -Not at the present time, but this may change.
  +Win NT/95/98 binarys for Apache/perl/mod_perl/Embperl are available from <A
  +HREF="http://www.perl.com/CPAN/authors/Jeffrey_Baker/">http://www.perl.com/CPAN/authors/Jeffrey_Baker/</A>
   
  +
   <P>
   <HR>
   <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="I_want_to_run_Embperl_with_mod_p">I want to run Embperl with mod_perl under Apache. In what order should I
  @@ -203,8 +213,128 @@
   </PRE>
   </OL>
   <P>
  -NOTE: Either of these approaches can often 'fix' SIGSEVs in any mod_perl
  +NOTE 1: Either of these approaches can often 'fix' SIGSEVs in any mod_perl
   handler, not just Embperl.
  +
  +<P>
  +NOTE 2: When mod_perl is compiled as loadable module (i.e. with USE_DSO)
  +you <STRONG>must not</STRONG> load Embperl at server startup time!
  +
  +<P>
  +<HR>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="make_test_fails_with_a_SIGxxxx_">make test fails with a SIGxxxx, how can I obtain a stack bactrace
  +from gdb?</A></H2>
  +<P>
  +The eaiest way is
  +
  +<P>
  +<PRE>        make install            -&gt; if Embperl is installed, it's easier
  +        gdb perl                -&gt; start the debugger with perl binary
  +        set args test.pl        -&gt; set the arguments for perl
  +        r                       -&gt; start the program
  +</PRE>
  +<P>
  +<PRE>        -&gt; Here you should receive the signal
  +</PRE>
  +<P>
  +<PRE>        share                   -&gt; makes sure all symbols are really loaded
  +        bt                      -&gt; show the backtrace
  +</PRE>
  +<P>
  +To get some more information it would be a good idea to compile Embperl
  +with debugging infomation enabled. Therefor do
  +
  +<P>
  +<HR>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="How_do_I_build_Embperl_with_debu">How do I build Embperl with debugging informations</A></H2>
  +<DL>
  +<DT><STRONG><A NAME="item_edit">edit the Makefile</A></STRONG><DD>
  +<DT><STRONG><A NAME="item_search">search for the line starting with 'CC = ' add the -g switch to the end of the line</A></STRONG><DD>
  +<DT><STRONG>search for the line starting with 'LDDFLAGS = ' add the -g switch to the end of the line</STRONG><DD>
  +<DT><STRONG><A NAME="item_type">type make to build Embperl with debugging infomation</A></STRONG><DD>
  +</DL>
  +<P>
  +now start the gdb as decribed before.
  +
  +<P>
  +<HR>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="make_test_fails_with_SIGXFSZ">make test fails with SIGXFSZ</A></H2>
  +<P>
  +This may occur when the filesize limit for the account, either test is
  +running as or the test httpd, is too small. Embperl make test generates a
  +really large logfile! Yu must increase the filesize limit for that
  +accounts.
  +
  +<P>
  +<HR>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="Embperl_on_SCO_Unix">Embperl on SCO Unix</A></H2>
  +<P>
  +&gt;From Red Plait
  +
  +<P>
  +My OS is SCO Unix 3.2v4.2, Apache 1.3.4, perl 5.004_4, mod_perl 1.18 and
  +Embperl-1.1.1
  +
  +<P>
  +I done following:
  +
  +<OL>
  +<LI><STRONG><A NAME="item__">)</A></STRONG>
  +<P>
  +I made HTML-Embperl-1.1.1 with no mod_perl support ( when I builded it with
  +mod_perl 1.18 I can`t link it because it don`t finds ap_XXX functions. When
  +I manually insert src/main/libmain.a from Apache 1.3.4 I got message
  +``Symbol main is multiple defined in /src/main/libmain.a. and perlmain.o''
  +). Then I ``make test'' - all tests was O`k. After this I ``make clean'',
  +``perl Makefile.pl'' with mod_perl support and ``make install''
  +
  +<LI><STRONG>)</STRONG>
  +<P>
  +I installed mod_perl and ``perl Makefile.PL'', then ``make''
  +
  +<LI><STRONG>)</STRONG>
  +<P>
  +because I have`nt dynamical loading ( very old and buggy OS ) I had to
  +manually change src/modules/perl/perlxsi.c to insert bootstraps function`s
  +and it`s invocations and also /src/Makefile to manually insert libXXX.a
  +libraries
  +
  +<DT><STRONG><A NAME="item_In">In access.conf I insert code:</A></STRONG><DD>
  +<P>
  +<PRE> PerlModule HTML::Embperl
  + &lt;Directory /my_dir&gt;
  +  SetHandler perl-script
  +  PerlHandler HTML::Embperl::handler
  + &lt;/Directory&gt;
  +</PRE>
  +</OL>
  +<P>
  +<HR>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="Embperl_does_not_write_to_the_lo">Embperl does not write to the logfile, because of missing permissions
  +of the user Apache runs as.</A></H2>
  +<P>
  +The apache server is started as root, then set the effective uid to user
  +``www'', who can then write to the embperl logfile (owned by root) file
  +handle that is passed along. However, if this log file handle is later
  +accidentally closed, then reopen, the www user would have problem writing
  +to it?
  +
  +<P>
  +The reopen is only done when the logfile name changes. As log as you don't
  +change the name on the logfile, the logfile will stay open.
  +
  +<P>
  +The problem (in this case) is, that Embperl init function ,(Init in
  +epmain.c) calls OpenLog will an second argument of zero. Which will only
  +save the filename. The log will actually opened on the first write to it
  +(or at the start of the first request). At this time your Apache has alreay
  +switch to user www. This is done to allow to change the logfile name before
  +an request, but after the init is already called (which is done when you or
  +Apache ``use'' the module)
  +
  +<P>
  +The current solutions is to write something to the log, before Apache
  +changes it's user (i.e. in the startup.pl)
   
   <p>[<a href="index.html">HOME</a>]&nbsp;&nbsp; [<a href="Faq.pod.cont.html">CONTENT</a>]&nbsp;&nbsp; [<a href="Faq.pod.cont.html">PREV (FAQ - Content)</a>]&nbsp;&nbsp; [<a href="Faq.pod.2.html">NEXT (Common Problems)</a>]&nbsp;&nbsp; <br>
       <font color="#808080">___________________________________________________________________________________<br>
  
  
  
  1.5       +28 -4     modperl-site/embperl/Faq.pod.2.html
  
  Index: Faq.pod.2.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Faq.pod.2.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Faq.pod.2.html	1999/02/15 12:34:08	1.4
  +++ Faq.pod.2.html	1999/05/07 20:24:52	1.5
  @@ -94,9 +94,13 @@
   section <A href="Faq.pod.1.html#Downloading_Compiling_Install">Downloading, Compiling & Installing</A>.
   
   <P>
  +NOTE: When mod_perl is compiled with <STRONG>USE_DSO</STRONG> it behaves vice versa and you may get SIGSEGVs when Embper is loaded at
  +server startup time.
  +
  +<P>
   <HR>
   <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="I_am_having_troubles_with_using_">I am having troubles with using Embperl in combination with
  -Apache::Include and Apache::Registry.</A></H2>
  +Apache::Include inside a Apache::Registry script.</A></H2>
   <P>
   This is a known problem, but it is a problem with mod_perl rather than with
   Embperl. It looks like mod_perl clears the request_rec after the first
  @@ -126,15 +130,35 @@
   <P>
   <HR>
   <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="I_can_t_figure_out_how_to_split_">I can't figure out how to split a 'while' statement across 
  -two [--] segments</A></H2>
  +two [- -] segments</A></H2>
   <P>
   That isn't surprising, as you cannot split Perl statements across multiple
  -blocks in Embperl :) You need to use a metacommand for that. The [$while$]
  -metacommand comes to mind... :) 
  +[- -] blocks in Embperl :) You need to use a metacommand for that. The
  +[$while$] metacommand comes to mind... :) 
   
   <P>
   For a list of all possible metacommands, see the section on 
   <A HREF="Embperl.pod.3.html#_Cmd_Arg_Meta_Commands_">Meta-Commands</A> in the Embperl documentation.
  +
  +<P>
  +<PRE>        [$ while $st -&gt; fetch $]
  +                #some html or other Embperl blocks goes here
  +        [$ endwhile $]
  +</PRE>
  +<P>
  +Newer Embperl versions (1.2b3 and above) supports the [* *] which can be
  +used for such purposes.
  +
  +<P>
  +<PRE>        [* while ($st -&gt; fetch) { *]
  +                #some html or other Embperl blocks goes here
  +        [* } *]
  +</PRE>
  +<P>
  +While the later can use all Perl control structures, the first seems to me
  +more readable and is better debugable, because Embperl controls the
  +execution of the control structure it can do a quite better job in debug
  +logging.
   
   <P>
   <HR>
  
  
  
  1.6       +145 -29   modperl-site/embperl/Faq.pod.3.html
  
  Index: Faq.pod.3.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Faq.pod.3.html,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Faq.pod.3.html	1999/02/15 12:34:09	1.5
  +++ Faq.pod.3.html	1999/05/07 20:24:52	1.6
  @@ -18,12 +18,12 @@
     <blockquote>
   [<a href="index.html">HOME</a>]&nbsp;&nbsp; [<a href="Faq.pod.cont.html">CONTENT</a>]&nbsp;&nbsp; [<a href="Faq.pod.2.html">PREV (Common Problems)</a>]&nbsp;&nbsp; [<a href="Faq.pod.4.html">NEXT (Escaping & Unescaping)</a>]&nbsp;&nbsp; <br>	<UL>
   
  -		<LI><A href="Faq.pod.3.html#What_is_the_difference_between_E">What is the difference between Embperl and ePerl (and ASP, etc)?</A>
   		<LI><A href="Faq.pod.3.html#How_can_I_get_my_HTML_files_to_b">How can I get my HTML files to be converted into Perl code which, as a</A>
   		<LI><A href="Faq.pod.3.html#I_have_an_HTML_page_which_is_dyn">I have an HTML page which is dynamically generated at runtime </A>
   		<LI><A href="Faq.pod.3.html#How_can_I_customise_the_header_t">How can I customise the header that Embperl is sending?</A>
   		<LI><A href="Faq.pod.3.html#Can_I_use_Embperl_to_send_cookie">Can I use Embperl to send cookies?</A>
   		<LI><A href="Faq.pod.3.html#Can_I_do_REDIRECT_with_Embperl_">Can I do REDIRECT with Embperl?</A>
  +		<LI><A href="Faq.pod.3.html#How_to_send_Location_Header_with">How to send Location Header with EmbedPerl</A>
   		<LI><A href="Faq.pod.3.html#Can_I_serve_random_GIFs_with_Emb">Can I serve random GIFs with Embperl?</A>
   		<LI><A href="Faq.pod.3.html#Can_I_use_Embperl_as_a_template_">Can I use Embperl as a template for forms?</A>
   		<LI><A href="Faq.pod.3.html#Does_Embperl_automatically_add_H">Does Embperl automatically add HIDDEN fields?</A>
  @@ -32,6 +32,8 @@
   		<LI><A href="Faq.pod.3.html#Are_Embperl_routines_currently_p">Are Embperl routines currently pre-compiled or even cached, or are only</A>
   		<LI><A href="Faq.pod.3.html#Why_are_Perl_blocks_broken_up_in">Why are Perl blocks broken up into single subroutines?</A>
   		<LI><A href="Faq.pod.3.html#Can_I_pass_QUERY_STRING_informat">Can I pass QUERY_STRING information to an HTML::Embperl::Execute call?</A>
  +		<LI><A href="Faq.pod.3.html#How_to_include_other_files_into_">How to include other files into Embperl pages?</A>
  +		<LI><A href="Faq.pod.3.html#How_to_display_arrays_with_undef">How to display arrays with undef values in it?</A>
   	</UL>
   <hr>
   <P>
  @@ -40,38 +42,15 @@
   
   <P>
   <HR>
  -<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="What_is_the_difference_between_E">What is the difference between Embperl and ePerl (and ASP, etc)?</A></H2>
  -<P>
  -ePerl also embeds Perl code in documents, but it doesn't know anything
  -about HTML. 
  -
  -<P>
  -Embperl's strongest features (the ones which have received the most
  -attention during development so far) are probably:
  -
  -<DL>
  -<DT><STRONG><A NAME="item__">- Dynamic Tables</A></STRONG><DD>
  -<DT><STRONG>- Formfields Processing</STRONG><DD>
  -<DT><STRONG>- Escaping/Unescaping</STRONG><DD>
  -<DT><STRONG>- Safe Namespaces</STRONG><DD>
  -</DL>
  -<P>
  -<HR>
   <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="How_can_I_get_my_HTML_files_to_b">How can I get my HTML files to be converted into Perl code which, as a
  -whole, could then be compiled as function named munge(URL) so that I could, for 
  +whole, could then be compiled as function so that I could, for 
   instance, fetch Perl docs from the Formatter table and compile them the
   way AUTOLOAD does.</A></H2>
   <P>
  -This is a very good example of a very long run-on sentence, and it is also
  -a very good example of a thing that ePerl would do better than Embperl.
  +Embperl cannot covert your HTML into one piece of Perl-code, but you can
  +wrap the call to Execute into a Perl function and let AUTOLOAD call it.
   
   <P>
  -See ePerl, by Ralf Engelschalls, at <A
  -HREF="http://www.engelschall.com.">http://www.engelschall.com.</A> See also
  -the previous question, ``What is the difference between Embperl and
  -ePerl?''
  -
  -<P>
   <HR>
   <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="I_have_an_HTML_page_which_is_dyn">I have an HTML page which is dynamically generated at runtime 
   and should be post-processed by Embperl. How can I do this?</A></H2>
  @@ -85,6 +64,8 @@
   HTML source from the disk or even from a database. Embperl also
   provides the function ProxyInput, which allows you to get input from
   another web server altogether.</A></STRONG>
  +<LI><STRONG><A NAME="item__Look_at_the_module_Apache_Emb">) Look at the module Apache::EmbperlChain, which is able to chain
  +multiple modules, including Embperl, together.</A></STRONG>
   </OL>
   <P>
   <HR>
  @@ -100,7 +81,7 @@
   header)
   
   <P>
  -or you can use
  +or (only when running under mod_perl) you can use
   
   <P>
   <PRE>    [- $req_rec -&gt; content_type ('text/html') -]
  @@ -126,6 +107,11 @@
   </PRE>
   </OL>
   <P>
  +NOTE: You make also take a look at Embperls (1.2b2 and above) ability to
  +handle sessions for you inside the <CODE>%udat</CODE> and
  +<CODE>%mdat</CODE> hashes.
  +
  +<P>
   <HR>
   <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="Can_I_do_REDIRECT_with_Embperl_">Can I do REDIRECT with Embperl?</A></H2>
   <P>
  @@ -146,8 +132,27 @@
   </PRE>
   <P>
   <HR>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="How_to_send_Location_Header_with">How to send Location Header with EmbedPerl</A></H2>
  +<P>
  +<PRE> 
  +Try
  +</PRE>
  +<P>
  +<PRE>    [-
  +       $req_rec -&gt;  header_out(&quot;Location&quot; =&gt; &quot;<A HREF="http://cnn.com/&quot">http://cnn.com/&quot</A>;);
  +       $req_rec -&gt;  status (302));
  +    -] 
  + 
  +(You may use the constants from Apache::Constants instead of the 302)
  +</PRE>
  +<P>
  +If there is nothing more to do on this page, you may call exit directly
  +after setting the status.
  +
  +<P>
  +<HR>
   <H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="Can_I_serve_random_GIFs_with_Emb">Can I serve random GIFs with Embperl?
  -(Will Leonard Stein's GD.pm module work with Embperl??)</A></H2>
  +(Will Lincoln Stein's GD.pm module work with Embperl??)</A></H2>
   <P>
   As always, there is more than one way to do this - especially as this is
   more of a question of how you are coding your HTML than how you are coding
  @@ -277,6 +282,117 @@
   With Embperl 1.0 and higher, you can do this. QUERY_STRING is set as
   $ENV{QUERY_STRING} by default. Alternatively, you can use the fdat
   parameter to pass values to %fdat.
  +
  +<P>
  +<HR>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="How_to_include_other_files_into_">How to include other files into Embperl pages?</A></H2>
  +<P>
  +I am using embedded Perl on my site and am curious if I can use it for
  +server side includes. I want to embed the contents of file x.html into file
  +y.html such that whenever I change x.html, displaying y.html will also
  +reflect this change. How do I do it using embedded perl?
  +
  +<P>
  +You need Embperl 1.2b4 or above. Then you can say inside of y.html:
  +
  +<P>
  +<PRE> [- Execute ('x.html') -]
  +</PRE>
  +<P>
  +I have a rather large table in a database which I'd like to display using
  +EmbPerl. All of the examples show a process of fetching all the data first,
  +then iterating through it using <CODE>$row</CODE> and $col, like this:
  +
  +<P>
  +<PRE>   [-
  +   $sth = $dbh -&gt; prepare (&quot;select * from $comptbl order by SubSystem&quot;);
  +   $sth -&gt; execute;
  +   $dref = $sth -&gt; fetchall_arrayref;
  +   -]
  +   &lt;TABLE&gt;
  +      ... $dref -&gt; [$row][0] ...
  +   &lt;/TABLE&gt;
  +</PRE>
  +<P>
  +I'd prefer to fetch the data one row at a time, how can I do this?
  +
  +<P>
  +For solution 1 you may write
  +
  +<P>
  +<PRE> &lt;table&gt;
  + [$while $rref = $sth -&gt; fetch $]
  +     &lt;tr&gt;....&lt;/tr&gt;
  + [$endwhile$]
  + &lt;/table&gt;
  +</PRE>
  +<P>
  +Solution 2 should work like this
  +
  +<P>
  +<PRE> &lt;table&gt;
  +    &lt;tr&gt; [- $dummy = $row ; $rref = $sth -&gt; fetch -]
  +            ....
  +    &lt;/tr&gt;
  + &lt;/table&gt;
  +</PRE>
  +<P>
  +The table ends when the expression where <CODE>$row</CODE> is used in some
  +way returns &lt;undef&gt;. So also there is no releation between
  +<CODE>$row</CODE> and the fetch, both conditions are met.
  +
  +<P>
  +<HR>
  +<H2><img src="sq.gif" width="16" height="16" alt="-"> <A NAME="How_to_display_arrays_with_undef">How to display arrays with undef values in it?</A></H2>
  +<P>
  +<PRE> 
  +I'm doing a search on a table where some of the columns have NULL and
  +non-NULL values.  DBIx::Recordset has no problem reading this values 
  +The problem is that I then tried to print these values
  +out in a table using Embperl's  table feature, like this.
  + 
  + &lt;TABLE&gt;
  + &lt;TR&gt;
  + &lt;TD&gt;$set[$row]{column_name1}&lt;/TD&gt;
  + &lt;TD&gt;$set[$row]{column_nameN}&lt;/TD&gt;
  + &lt;/TR&gt;
  + 
  + The problem is that I got 5 rows instead of the 15 that I was expected.  I
  + have been  trying all kinds of tweaks to the arguments to the Search
  + function and getting nowwhere, until I re-read the Embperl docs.  Embperl
  + will not print out a table row if one of the columns has an 
  + expression that
  + is undefined.  This is a problem since DBIx::Recordset (and DBI)
  + natually uses undef to represent a NULL value for a column.  So I made a
  + slight modification to my embperl code.
  + 
  + &lt;TABLE&gt;
  + &lt;TR&gt;
  + &lt;TD&gt;defined($set[$row]{column_name1}) ? $set[$row]{column_name1} :
  + &quot;UNDEF&quot;&lt;/TD&gt;
  +                                 .   .   .
  + &lt;TD&gt;$set[$row]{column_nameN} ? $set[$row]{column_nameN} : &quot;UNDEF&quot;&lt;/TD&gt;
  + &lt;/TR&gt;
  + 
  +Now all 15 rows appear as expected, with &quot;UNDEF&quot; representing the NULL
  +values in the database.
  +</PRE>
  +<P>
  +Another way top solve you problem may be:
  +
  +<P>
  +<PRE> &lt;TABLE&gt;
  + &lt;TR&gt;
  + [- $r = $set[$row] -]
  + &lt;TD&gt; [+ $r -&gt; {column_name1} +] &lt;/TD&gt;
  +                                 .   .   .
  + &lt;TD&gt; [+ $r -&gt; {column_nameN} +] &lt;/TD&gt;
  + &lt;/TR&gt;
  +</PRE>
  +<P>
  +This will only refer one time to <CODE>$row</CODE> and the expression is
  +defined, as long as the row could be fetched from the db. All NULL fields
  +will be displayed as empty table cells.
   
   <p>[<a href="index.html">HOME</a>]&nbsp;&nbsp; [<a href="Faq.pod.cont.html">CONTENT</a>]&nbsp;&nbsp; [<a href="Faq.pod.2.html">PREV (Common Problems)</a>]&nbsp;&nbsp; [<a href="Faq.pod.4.html">NEXT (Escaping & Unescaping)</a>]&nbsp;&nbsp; <br>
       <font color="#808080">___________________________________________________________________________________<br>
  
  
  
  1.6       +1 -1      modperl-site/embperl/Faq.pod.4.html
  
  Index: Faq.pod.4.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Faq.pod.4.html,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Faq.pod.4.html	1999/02/15 12:34:09	1.5
  +++ Faq.pod.4.html	1999/05/07 20:24:52	1.6
  @@ -139,7 +139,7 @@
       @a = ('a', 'b', 'c') ;
       -]
       &lt;table&gt;
  -    &lt;tr&gt;&lt;td&gt;Row $a[$row]&lt;/td&gt;&lt;/tr&gt;&quot; ;
  +    &lt;tr&gt;&lt;td&gt;Row [+ $a[$row] +]&lt;/td&gt;&lt;/tr&gt;&quot; ;
       &lt;/table&gt;
   </PRE>
   <P>
  
  
  
  1.5       +4 -0      modperl-site/embperl/Faq.pod.5.html
  
  Index: Faq.pod.5.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Faq.pod.5.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Faq.pod.5.html	1999/02/15 12:34:09	1.4
  +++ Faq.pod.5.html	1999/05/07 20:24:52	1.5
  @@ -73,6 +73,10 @@
   <LI><STRONG><A NAME="item__Disable_all_unneeded_debugging">) Disable all unneeded debugging flags. You should never set 
       dbgFlushLog dbgFlushOutput, dbgMem and dbgEvalNoCache in a
       production environment.</A></STRONG>
  +<LI><STRONG><A NAME="item__You_may_also_want_to_take_a_lo">) You may also want to take a look at the available options
  +    you can set via EMBPERL_OPTIONS. For example optDisableChdir, will
  +    speed up processing because it avoid the change directory before
  +    every request.</A></STRONG>
   </OL>
   <p>[<a href="index.html">HOME</a>]&nbsp;&nbsp; [<a href="Faq.pod.cont.html">CONTENT</a>]&nbsp;&nbsp; [<a href="Faq.pod.4.html">PREV (Escaping & Unescaping)</a>]&nbsp;&nbsp; [<a href="Faq.pod.6.html">NEXT (Customizing)</a>]&nbsp;&nbsp; <br>
       <font color="#808080">___________________________________________________________________________________<br>
  
  
  
  1.5       +2 -1      modperl-site/embperl/Faq.pod.6.html
  
  Index: Faq.pod.6.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Faq.pod.6.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Faq.pod.6.html	1999/02/15 12:34:09	1.4
  +++ Faq.pod.6.html	1999/05/07 20:24:53	1.5
  @@ -32,7 +32,8 @@
   <P>
   Usually, defaults are set in a way that is likely to make most sense for a
   majority of users. As of version 1.0, Embperl allows much more flexibility
  -in tweaking your own default values than before. 
  +in tweaking your own default values than before. Take a look at
  +EMBERPL_OPTIONS.
   
   <P>
   <HR>
  
  
  
  1.5       +3 -1      modperl-site/embperl/Faq.pod.7.html
  
  Index: Faq.pod.7.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Faq.pod.7.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Faq.pod.7.html	1999/02/15 12:34:11	1.4
  +++ Faq.pod.7.html	1999/05/07 20:24:53	1.5
  @@ -65,7 +65,9 @@
   CGI.pm object instead of creating its own?</A></H2>
   <P>
   Embperl only creates a CGI objects to process multipart form data (from
  -fileupload). In all other cases Embperl doesn't use CGI.pm
  +fileupload). In all other cases Embperl doesn't use CGI.pm. There is no way
  +to change this behaviour, or access the internal CGI object in case of
  +file-uploads.
   
   <p>[<a href="index.html">HOME</a>]&nbsp;&nbsp; [<a href="Faq.pod.cont.html">CONTENT</a>]&nbsp;&nbsp; [<a href="Faq.pod.6.html">PREV (Customizing)</a>]&nbsp;&nbsp; [<a href="Faq.pod.8.html">NEXT (Additional Help)</a>]&nbsp;&nbsp; <br>
       <font color="#808080">___________________________________________________________________________________<br>
  
  
  
  1.5       +9 -2      modperl-site/embperl/Faq.pod.cont.html
  
  Index: Faq.pod.cont.html
  ===================================================================
  RCS file: /export/home/cvs/modperl-site/embperl/Faq.pod.cont.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Faq.pod.cont.html	1999/02/15 12:34:12	1.4
  +++ Faq.pod.cont.html	1999/05/07 20:24:53	1.5
  @@ -31,7 +31,7 @@
   	<LI><A href="Faq.pod.1.html#Downloading_Compiling_Install">Downloading, Compiling &amp; Installing</A>
   	<UL>
   
  -		<LI><A href="Faq.pod.1.html#Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl?</A>
  +		<LI><A href="Faq.pod.1.html#Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl for Unix?</A>
   		<LI><A href="Faq.pod.1.html#Is_there_a_binary_distribution_o">Is there a binary distribution of Embperl for Win32?</A>
   		<LI><A href="Faq.pod.1.html#I_want_to_run_Embperl_with_mod_p">I want to run Embperl with mod_perl under Apache. In what order should I</A>
   		<LI><A href="Faq.pod.1.html#I_m_getting_">I'm getting:</A>
  @@ -40,6 +40,11 @@
   		<LI><A href="Faq.pod.1.html#Running_make_test_fails_with_a">Running 'make test' fails with an error message at loading of Embperl </A>
   		<LI><A href="Faq.pod.1.html#How_can_I_build_a_statically_lin">How can I build a statically-linked copy of Embperl with mod_perl </A>
   		<LI><A href="Faq.pod.1.html#How_do_I_load_Embperl_at_server_">How do I load Embperl at server startup?</A>
  +		<LI><A href="Faq.pod.1.html#make_test_fails_with_a_SIGxxxx_">make test fails with a SIGxxxx, how can I obtain a stack bactrace</A>
  +		<LI><A href="Faq.pod.1.html#How_do_I_build_Embperl_with_debu">How do I build Embperl with debugging informations</A>
  +		<LI><A href="Faq.pod.1.html#make_test_fails_with_SIGXFSZ">make test fails with SIGXFSZ</A>
  +		<LI><A href="Faq.pod.1.html#Embperl_on_SCO_Unix">Embperl on SCO Unix</A>
  +		<LI><A href="Faq.pod.1.html#Embperl_does_not_write_to_the_lo">Embperl does not write to the logfile, because of missing permissions</A>
   	</UL>
   
   	<LI><A href="Faq.pod.2.html#Common_Problems">Common Problems</A>
  @@ -61,12 +66,12 @@
   	<LI><A href="Faq.pod.3.html#Common_Questions">Common Questions</A>
   	<UL>
   
  -		<LI><A href="Faq.pod.3.html#What_is_the_difference_between_E">What is the difference between Embperl and ePerl (and ASP, etc)?</A>
   		<LI><A href="Faq.pod.3.html#How_can_I_get_my_HTML_files_to_b">How can I get my HTML files to be converted into Perl code which, as a</A>
   		<LI><A href="Faq.pod.3.html#I_have_an_HTML_page_which_is_dyn">I have an HTML page which is dynamically generated at runtime </A>
   		<LI><A href="Faq.pod.3.html#How_can_I_customise_the_header_t">How can I customise the header that Embperl is sending?</A>
   		<LI><A href="Faq.pod.3.html#Can_I_use_Embperl_to_send_cookie">Can I use Embperl to send cookies?</A>
   		<LI><A href="Faq.pod.3.html#Can_I_do_REDIRECT_with_Embperl_">Can I do REDIRECT with Embperl?</A>
  +		<LI><A href="Faq.pod.3.html#How_to_send_Location_Header_with">How to send Location Header with EmbedPerl</A>
   		<LI><A href="Faq.pod.3.html#Can_I_serve_random_GIFs_with_Emb">Can I serve random GIFs with Embperl?</A>
   		<LI><A href="Faq.pod.3.html#Can_I_use_Embperl_as_a_template_">Can I use Embperl as a template for forms?</A>
   		<LI><A href="Faq.pod.3.html#Does_Embperl_automatically_add_H">Does Embperl automatically add HIDDEN fields?</A>
  @@ -75,6 +80,8 @@
   		<LI><A href="Faq.pod.3.html#Are_Embperl_routines_currently_p">Are Embperl routines currently pre-compiled or even cached, or are only</A>
   		<LI><A href="Faq.pod.3.html#Why_are_Perl_blocks_broken_up_in">Why are Perl blocks broken up into single subroutines?</A>
   		<LI><A href="Faq.pod.3.html#Can_I_pass_QUERY_STRING_informat">Can I pass QUERY_STRING information to an HTML::Embperl::Execute call?</A>
  +		<LI><A href="Faq.pod.3.html#How_to_include_other_files_into_">How to include other files into Embperl pages?</A>
  +		<LI><A href="Faq.pod.3.html#How_to_display_arrays_with_undef">How to display arrays with undef values in it?</A>
   	</UL>
   
   	<LI><A href="Faq.pod.4.html#Escaping_Unescaping">Escaping &amp; Unescaping</A>