You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by "Beau E. Cox" <be...@beaucox.com> on 2004/03/23 12:54:12 UTC

Newbie trying Apache 2 / mod_perl 2 / Embperl

Hi -

I have been unsuccessful in getting Embperl working in my
environment (see the bottom of this message). I can't seem to find
a mod_perl 2 'sample' configuration file on the Embperl site
or in the distribution ( soulds like a good thing to have in the
eg/ directory ).

I get the following message when trying to access my web page:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to 
complete your request.

Please contact the server administrator, webmaster@beaucox.com and inform them 
of the time the error occurred, and anything you might have done that may 
have caused the error.

[19409]ERR: 24: Error in Perl code: (in cleanup) Can't call method "app" on an 
undefined value 
at /home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3/i686-linux-thread-multi/Embperl/Util.pm 
line 107.

Embperl/2.0b11 Apache/2.0.50-dev (Unix) mod_perl/1.99_14-dev Perl/v5.8.3 
mod_ssl/2.0.50-dev OpenSSL/0.9.7d DAV/2 [Tue Mar 23 01:30:18 2004]

The log shows:

[Tue Mar 23 01:30:18 2004] [error] [19409]ERR:  24:  Error in Perl code: \t(in 
cleanup) Can't call method "app" on an undefined value 
at /home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3/i686-linux-thread-multi/Embperl/Util.pm 
line 107.


I have my httpd.conf setup as follows:

### Section 3: mod_perl and embperl

#-------------------mod_perl---------------------------------
LoadModule perl_module /home/test/usr/apache2/lib/apache/mod_perl.so
LoadModule apreq_module /home/test/usr/apache2/lib/apache/mod_apreq.so
LoadModule cgid_module /home/test/usr/apache2/lib/apache/mod_cgid.so
LoadModule embperl_module 
"/home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3/i686-linux-thread-multi/auto/Embperl/Embperl.so"

PerlSetEnv MOD_PERL_INC	"/home/test/httpd/perl"
PerlRequire "/home/test/httpd/conf/ep-startup.pl"

PerlModule Apache::Reload
PerlInitHandler Apache::Reload

#-------------------embperl----------------------------------

PerlModule Embperl

AddType text/html .epl

<Files *.epl>
  SetHandler          perl-script
  PerlResponseHandler Embperl
  Options             ExecCGI
</files>

### Section 4: Virtual Hosts

Listen 12984
NameVirtualHost localhost:12984

# for general testing - default - on localhost

<VirtualHost localhost:12984>
  EMBPERL_APPNAME my_embperl_app
  EMBPERL_OBJECT_BASE base.epl
  ServerName bctest.with.embperl.beaucox.com
  DocumentRoot "/home/test/httpd/htdocs/bctest_with_embperl"
  SetHandler          perl-script
  PerlResponseHandler Embperl::Object
  Options             ExecCGI
</VirtualHost>

And my startup script is:

###################################################
#	mod_perl startup script
#	adapded by Beau E. Cox
#	December 4, 2002
#
#	file:startup.pl
###################################################

use Apache2 ();
use Apache::compat ();

use lib ( $ENV{MOD_PERL_INC} );

use CGI ();

use ModPerl::Util (); #for CORE::GLOBAL::exit

use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::RequestUtil ();

use Apache::Server ();
use Apache::ServerUtil ();
use Apache::Connection ();
use Apache::Log ();

use Apache::Session ();

use APR::Table ();

use ModPerl::Registry ();

use Apache::Const -compile => ':common';
use APR::Const -compile => ':common';
use ModPerl::Const -compile => ':common';

use DBI ();
use Apache::DBI ();

1;



*** Sorcerer Linux - current
*** kernel 2.6.5-rc2

*** mod_perl version 1.9914

*** using lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_APXS        => /home/test/usr/apache2/sbin/apxs
  MP_COMPAT_1X   => 1
  MP_GENERATE_XS => 1
  MP_LIBNAME     => mod_perl
  MP_USE_DSO     => 1
  MP_USE_STATIC  => 1


*** /home/test/usr/apache2/sbin/httpd -V
Server version: Apache/2.0.50-dev
Server built:   Mar 22 2004 23:36:23
Server's Module Magic Number: 20020903:7
Architecture:   32-bit
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/worker"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT="/home/test/usr/apache2"
 -D SUEXEC_BIN="/home/test/usr/apache2/bin/suexec"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/home/test/httpd/conf/mime.types"
 -D SERVER_CONFIG_FILE="/home/test/httpd/conf/httpd.conf"


*** /home/test/perl/5.8.3-ithread/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.4.25, archname=i686-linux-thread-multi
    uname='linux cathy.beaucox.com 2.4.25 #1 fri feb 20 11:05:53 hst 2004 i686 
unknown unknown gnulinux '
    config_args='-Dprefix=/home/test/perl/5.8.3-ithread -d -e -Dusethreads 
-Duseshrplib'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define 
usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64',
    optimize='-O3',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS 
-fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.3.3', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', 
lseeksize=8
    alignbytes=4, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic 
-Wl,-rpath,/home/test/perl/5.8.3-ithread/lib/5.8.3/i686-linux-thread-multi/CORE'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES 
PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Feb 27 2004 10:42:45
  %ENV:
    PERL_LWP_USE_HTTP_10="1"
  @INC:
    /home/test/perl/5.8.3-ithread/lib/5.8.3/i686-linux-thread-multi
    /home/test/perl/5.8.3-ithread/lib/5.8.3
    /home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3/i686-linux-thread-multi
    /home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3
    /home/test/perl/5.8.3-ithread/lib/site_perl
    .

*** Packages of interest status:

Apache::Request: 2.03-dev
CGI            : 3.01
LWP            : 5.76
mod_perl       : 1.9914

Aloha => Beau;





---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Newbie trying Apache 2 / mod_perl 2 / Embperl

Posted by "Beau E. Cox" <be...@beaucox.com>.
On Thursday 25 March 2004 04:00 am, Gerald Richter wrote:
> Hi,
>
> > I have been unsuccessful in getting Embperl working in my
> > environment (see the bottom of this message). I can't seem to find
> > a mod_perl 2 'sample' configuration file on the Embperl site
> > or in the distribution ( soulds like a good thing to have in the
> > eg/ directory ).
>
> Does make test work correctly for you ?
>
> If yes, could you try to add a
>
> use Embperl ;
>
> at the end of your startup script and remove the PerlModule EMbperl form
> your httpd.conf?
>
> Gerald

Thank you Gerald -

My problem was Apach2 was using MPM 'worker', Changed to 'prefork'
and it works.

The 'make test' still had erros, but the system works.

Aloha => Beau;



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Newbie trying Apache 2 / mod_perl 2 / Embperl

Posted by Gerald Richter <ri...@ecos.de>.
Hi,

>
> I have been unsuccessful in getting Embperl working in my
> environment (see the bottom of this message). I can't seem to find
> a mod_perl 2 'sample' configuration file on the Embperl site
> or in the distribution ( soulds like a good thing to have in the
> eg/ directory ).
>

Does make test work correctly for you ?

If yes, could you try to add a

use Embperl ;

at the end of your startup script and remove the PerlModule EMbperl form
your httpd.conf?

Gerald


> I get the following message when trying to access my web page:
>
> Internal Server Error
> The server encountered an internal error or misconfiguration and was
> unable to
> complete your request.
>
> Please contact the server administrator, webmaster@beaucox.com and
> inform them
> of the time the error occurred, and anything you might have done that
> may
> have caused the error.
>
> [19409]ERR: 24: Error in Perl code: (in cleanup) Can't call method
> "app" on an
> undefined value
> at
>
/home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3/i686-linux-thread-multi/Em
bperl/Util.pm
> line 107.
>
> Embperl/2.0b11 Apache/2.0.50-dev (Unix) mod_perl/1.99_14-dev
> Perl/v5.8.3
> mod_ssl/2.0.50-dev OpenSSL/0.9.7d DAV/2 [Tue Mar 23 01:30:18 2004]
>
> The log shows:
>
> [Tue Mar 23 01:30:18 2004] [error] [19409]ERR:  24:  Error in Perl
> code: \t(in
> cleanup) Can't call method "app" on an undefined value
> at
>
/home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3/i686-linux-thread-multi/Em
bperl/Util.pm
> line 107.
>
>
> I have my httpd.conf setup as follows:
>
> ### Section 3: mod_perl and embperl
>
> #-------------------mod_perl---------------------------------
> LoadModule perl_module /home/test/usr/apache2/lib/apache/mod_perl.so
> LoadModule apreq_module /home/test/usr/apache2/lib/apache/mod_apreq.so
> LoadModule cgid_module /home/test/usr/apache2/lib/apache/mod_cgid.so
> LoadModule embperl_module
>
"/home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3/i686-linux-thread-multi/a
uto/Embperl/Embperl.so"
>
> PerlSetEnv MOD_PERL_INC "/home/test/httpd/perl"
> PerlRequire "/home/test/httpd/conf/ep-startup.pl"
>
> PerlModule Apache::Reload
> PerlInitHandler Apache::Reload
>
> #-------------------embperl----------------------------------
>
> PerlModule Embperl
>
> AddType text/html .epl
>
> <Files *.epl>
>   SetHandler          perl-script
>   PerlResponseHandler Embperl
>   Options             ExecCGI
> </files>
>
> ### Section 4: Virtual Hosts
>
> Listen 12984
> NameVirtualHost localhost:12984
>
> # for general testing - default - on localhost
>
> <VirtualHost localhost:12984>
>   EMBPERL_APPNAME my_embperl_app
>   EMBPERL_OBJECT_BASE base.epl
>   ServerName bctest.with.embperl.beaucox.com
>   DocumentRoot "/home/test/httpd/htdocs/bctest_with_embperl"
>   SetHandler          perl-script
>   PerlResponseHandler Embperl::Object
>   Options             ExecCGI
> </VirtualHost>
>
> And my startup script is:
>
> ###################################################
> # mod_perl startup script
> # adapded by Beau E. Cox
> # December 4, 2002
> #
> # file:startup.pl
> ###################################################
>
> use Apache2 ();
> use Apache::compat ();
>
> use lib ( $ENV{MOD_PERL_INC} );
>
> use CGI ();
>
> use ModPerl::Util (); #for CORE::GLOBAL::exit
>
> use Apache::RequestRec ();
> use Apache::RequestIO ();
> use Apache::RequestUtil ();
>
> use Apache::Server ();
> use Apache::ServerUtil ();
> use Apache::Connection ();
> use Apache::Log ();
>
> use Apache::Session ();
>
> use APR::Table ();
>
> use ModPerl::Registry ();
>
> use Apache::Const -compile => ':common';
> use APR::Const -compile => ':common';
> use ModPerl::Const -compile => ':common';
>
> use DBI ();
> use Apache::DBI ();
>
> 1;
>
>
>
> *** Sorcerer Linux - current
> *** kernel 2.6.5-rc2
>
> *** mod_perl version 1.9914
>
> *** using lib/Apache/BuildConfig.pm
> *** Makefile.PL options:
>   MP_APXS        => /home/test/usr/apache2/sbin/apxs
>   MP_COMPAT_1X   => 1
>   MP_GENERATE_XS => 1
>   MP_LIBNAME     => mod_perl
>   MP_USE_DSO     => 1
>   MP_USE_STATIC  => 1
>
>
> *** /home/test/usr/apache2/sbin/httpd -V
> Server version: Apache/2.0.50-dev
> Server built:   Mar 22 2004 23:36:23
> Server's Module Magic Number: 20020903:7
> Architecture:   32-bit
> Server compiled with....
>  -D APACHE_MPM_DIR="server/mpm/worker"
>  -D APR_HAS_SENDFILE
>  -D APR_HAS_MMAP
>  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
>  -D APR_USE_SYSVSEM_SERIALIZE
>  -D APR_USE_PTHREAD_SERIALIZE
>  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
>  -D APR_HAS_OTHER_CHILD
>  -D AP_HAVE_RELIABLE_PIPED_LOGS
>  -D HTTPD_ROOT="/home/test/usr/apache2"
>  -D SUEXEC_BIN="/home/test/usr/apache2/bin/suexec"
>  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
>  -D DEFAULT_ERRORLOG="logs/error_log"
>  -D AP_TYPES_CONFIG_FILE="/home/test/httpd/conf/mime.types"
>  -D SERVER_CONFIG_FILE="/home/test/httpd/conf/httpd.conf"
>
>
> *** /home/test/perl/5.8.3-ithread/bin/perl -V
> Summary of my perl5 (revision 5.0 version 8 subversion 3)
>   configuration: Platform:
>     osname=linux, osvers=2.4.25, archname=i686-linux-thread-multi
>     uname='linux cathy.beaucox.com 2.4.25 #1 fri feb 20 11:05:53 hst
> 2004 i686
> unknown unknown gnulinux '
>     config_args='-Dprefix=/home/test/perl/5.8.3-ithread -d -e
> -Dusethreads -Duseshrplib'
>     hint=recommended, useposix=true, d_sigaction=define
>     usethreads=define use5005threads=undef useithreads=define
> usemultiplicity=define
>     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
>     use64bitint=undef use64bitall=undef uselongdouble=undef
>     usemymalloc=n, bincompat5005=undef
>   Compiler:
>     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
> -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
> -D_FILE_OFFSET_BITS=64',
>     optimize='-O3',
>     cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
> -fno-strict-aliasing -I/usr/local/include'
>     ccversion='', gccversion='3.3.3', gccosandvers=''
>     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
>     d_longlong=define, longlongsize=8, d_longdbl=define,
>     longdblsize=12 ivtype='long', ivsize=4, nvtype='double',
> nvsize=8, Off_t='off_t',
> lseeksize=8
>     alignbytes=4, prototype=define
>   Linker and Libraries:
>     ld='cc', ldflags =' -L/usr/local/lib'
>     libpth=/usr/local/lib /lib /usr/lib
>     libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lpthread -lc
>     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
>     libc=/lib/libc-2.3.2.so, so=so, useshrplib=true,
>     libperl=libperl.so gnulibc_version='2.3.2'
>   Dynamic Linking:
>     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef,
> ccdlflags='-rdynamic
>
> -Wl,-rpath,/home/test/perl/5.8.3-ithread/lib/5.8.3/i686-linux-thread-multi
/CORE'
> cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
>
>
> Characteristics of this binary (from libperl):
>   Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
> PERL_IMPLICIT_CONTEXT
>   Built under linux
>   Compiled at Feb 27 2004 10:42:45
>   %ENV:
>     PERL_LWP_USE_HTTP_10="1"
>   @INC:
>     /home/test/perl/5.8.3-ithread/lib/5.8.3/i686-linux-thread-multi
>     /home/test/perl/5.8.3-ithread/lib/5.8.3
>
>
>
>
> /home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3/i686-linux-thread-multi
> /home/test/perl/5.8.3-ithread/lib/site_perl/5.8.3
> /home/test/perl/5.8.3-ithread/lib/site_perl .
>
> *** Packages of interest status:
>
> Apache::Request: 2.03-dev
> CGI            : 3.01
> LWP            : 5.76
> mod_perl       : 1.9914
>
> Aloha => Beau;
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org

---------------------------------------------------------------------------
Gerald Richter            ecos electronic communication services gmbh
IT-Securitylösungen * Webapplikationen mit Apache/Perl/mod_perl/Embperl

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
---------------------------------------------------------------------------
Besuchen Sie uns auf der CeBIT (18. - 24. März 2004)
Halle 6 Stand B38-452

ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
---------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Design decision / embperl or mason? :-)

Posted by Angus Lees <gu...@inodes.org>.
I posted a brief (somewhat opinionated) comparison with Mason last
December when someone asked the same question:
 http://www.ecos.de/~mailarc/embperl/2003-12/msg00049.html

At Tue, 23 Mar 2004 22:50:05 +0100, Oliver Brandt wrote:
> One of the most important things for me is the MVC - pardigm because
> I want to separate content and logic. How can I implement this
> method with embperl? (Because embperl is embedding perlcode in HTML)
> It's more the JavaServerPages/Java Beans concept I prefer. Only
> snippets of perlcode in my HTML and behind that the more logical
> stuff if needed.

Just as you said: have only snippets of perl code in your HTML and put
all the heavy code into other files.  As with any of these tools, good
MVC separation is largely a result of clean design and disciplined
coding - the tool only provides the mechanisms for achieving that.

I tend to use normal perl modules for the "Model" parts, Embperl pages
for the "View" parts and the Embperl (v2) application object for the
"Controller" part.  In practice, the lines get a little blurred since
the real goal here is code maintainability - not some pretty Visio
diagram.

(Before there was a separate Embperl application object, I used the
page requested (.html) as the controller, and Embperl fragments (.epl)
as view)

-- 
 - Gus


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Design decision / embperl or mason? :-)

Posted by Carlos Kassab <ck...@eplsite.org>.
Maybe you would want to start with eplsite.org, it is a web portal and 
workflow system written using embperl.

CKG

Oliver Brandt escribió:

> Ed Grimm schrieb:
>
>> We use traditional perl modules for the majority of our logic; web pages
>> only contain code to output into HTML.  As such, we only use the full
>> power of Embperl a few places.  However, it gives us our separation, and
>> allows us to write simple command-line tools that use the same
>> libraries, which gives us batch capabilities which we didn't want to
>> work into our web pages, in addition to command-line debugging tools.
>
>
> where can I find some code examples? Could you post a URL
> where I can find some stuff who shows me how to separate
> content and logic? I would really appreciate. Thanx for your
> feedback :-)
>
> Regards Oliver
>

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Design decision / embperl or mason? :-)

Posted by Oliver Brandt <th...@gmx.de>.
Ed Grimm schrieb:

> We use traditional perl modules for the majority of our logic; web pages
> only contain code to output into HTML.  As such, we only use the full
> power of Embperl a few places.  However, it gives us our separation, and
> allows us to write simple command-line tools that use the same
> libraries, which gives us batch capabilities which we didn't want to
> work into our web pages, in addition to command-line debugging tools.

where can I find some code examples? Could you post a URL
where I can find some stuff who shows me how to separate
content and logic? I would really appreciate. Thanx for your
feedback :-)

Regards Oliver

-- 
  /"\		mailto:the.unchallenged@gmx.de
  \ /		http://www.the-unchallenged.de
   X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
  / \		


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Design decision / embperl or mason? :-)

Posted by Brent 'Dax' Royal-Gordon <br...@brentdax.com>.
Ed Grimm wrote:
> Note that this requires web server restarts to change the logic, rather
> than just editing the pages.

Also note that, if you're not in a very high load environment, 
Apache::Reload can be used to deal with this issue.  (Granted, you may 
be in such an environment, but even if you are the original poster may not.)

To respond directly to the original poster:  I see nothing in your 
requirements that Embperl cannot handle, and the "put all your logic in 
modules" method works well enough with Embperl.

On one of my sites, I've abstracted a few pieces of common display, 
authentication, and file upload logic into a module, but otherwise 
everything is in the pages.  The modules capture a few variables (%fdat, 
%http_header_out) from the calling package into lexical variables, then 
export methods into the calling package with the standard Exporter 
module.  This setup worked fine without Apache::Reload, but with the 
module it's ridiculously easy to handle updates.

You can grab Apache::Reload from your favorite CPAN mirror.  It's a 
pure-Perl module, with configuration directives inserted into your 
httpd.conf file.

-- 
Brent "Dax" Royal-Gordon <br...@brentdax.com>
Perl and Parrot hacker

Oceania has always been at war with Eastasia.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Design decision / embperl or mason? :-)

Posted by Ed Grimm <ed...@dsblade00.wat.us.ray.com>.
On Tue, 23 Mar 2004, Oliver Brandt wrote:

> One of the most important things for me is the MVC - pardigm because I
> want to separate content and logic. How can I implement this method
> with embperl? (Because embperl is embedding perlcode in HTML) It's
> more the JavaServerPages/Java Beans concept I prefer. Only snippets of
> perlcode in my HTML and behind that the more logical stuff if needed.

We use traditional perl modules for the majority of our logic; web pages
only contain code to output into HTML.  As such, we only use the full
power of Embperl a few places.  However, it gives us our separation, and
allows us to write simple command-line tools that use the same
libraries, which gives us batch capabilities which we didn't want to
work into our web pages, in addition to command-line debugging tools.

Note that this requires web server restarts to change the logic, rather
than just editing the pages.  However, given our formalized processes
for making updates, virtually all of our changes are made during
scheduled downtime windows; breakfix changes are very rare.  As such,
taking the web server down briefly is ok for us.  If it wasn't, there's
a trick we could do involving multiple web servers and port redirection
(which I'm sure you've seen, given the length of time you've been
reading the group).

Ed

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Design decision / embperl or mason? :-)

Posted by Oliver Brandt <th...@gmx.de>.
Thanx to all guys for your reply. Finally I made my
decision for embperl :-)

Regards Oliver

-- 
  /"\		mailto:the.unchallenged@gmx.de
  \ /		http://www.the-unchallenged.de
   X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
  / \		


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re[2]: Design decision / embperl or mason? :-)

Posted by "Luiz Fernando B. Ribeiro" <lu...@engenhosolucoes.com.br>.
Oliver,

Tuesday, March 23, 2004, 6:50:05 PM, você escreveu:

OB> to give you a glue what I'm talking about I'll try to tell
OB> you something aboutthe features of the application:
OB> - user login (session management)
OB> - editing and of course creating a user profile
OB> - personalized user profile (differend colors, fonts - ok, CSS is my friend
OB>     but also should be stored in a database)
OB> - creating a user specific page with personalized information
OB>     (calendar/reminder function, picture, birthdate etc)
OB> - sending and recieve short messages (called SMS for GSM phones)
OB>     to/from other users if they have an account in my portal)
OB> - sending little messages to other users (inbox/outbox - own
OB>     messaging system, not based on pop/smtp!!!)
OB> - creating own little "information channels" I mean messages that
OB>     should be posted at the personlized site of other users if they
OB>     supscript to these "information channels" from other users
OB> - uploading pictures
OB> - wide database searches, searching for other users and content
OB>     (DBIx::Recordset :-)

I think you will have no problems with this.

OB> One of the most important things for me is the MVC - pardigm because
OB> I want to separate content and logic. How can I implement this method
OB> with embperl? (Because embperl is embedding perlcode in HTML) It's more
OB> the JavaServerPages/Java Beans concept I prefer. Only snippets of 
OB> perlcode in
OB> my HTML and behind that the more logical stuff if needed.

To achieve this I implement the logic of the application in a module
using OO syntax. In the pages itself I try to maintain
just the basics to layout the page.

To avoid restart the server, as Ed noted, you can also use
Apache::Reload, or implement your own change detect mechanism.

Currently, I use the following design:

Database level: My own but could be DBIx::Recordset
Application level: Perl modules implementing the logic
Interface level: a bunch of Embperl "objects" implementing an API to
build forms, session management, screen handling, and anything
reusable related to output; and another bunch of Javascript libraries
to help with HTML tricks, CSS, and etc.

The Embperl "objects" are a better place to implement parts of the logic
related to output because you can use the power of Embperl instead of
print OUT and other tricks when you have to output inside common perl
modules. This also gives you a very good way to reuse code, I use my
"objects" in all my current projects, just like any plain perl module.

With this implementation I think things are well isolated, and as Ed
noted also, the logic is available to command line tools.

Maybe other people have other suggestions on this matter.

OB> I know this too but thanx for your information and feedback.
OB> I appreciate :-) Any additional questions about the application, luiz?

I think you will have a lot of fun in the near future...

Regards,

-- 
Luiz Fernando B. Ribeiro
Engenho Soluções para a Internet


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Design decision / embperl or mason? :-)

Posted by Oliver Brandt <th...@gmx.de>.
Luiz Fernando B. Ribeiro schrieb:

> What exactly do you mean by real big? Give some numbers and maybe some
> of the list members may help.

to give you a glue what I'm talking about I'll try to tell
you something aboutthe features of the application:
- user login (session management)
- editing and of course creating a user profile
- personalized user profile (differend colors, fonts - ok, CSS is my friend
    but also should be stored in a database)
- creating a user specific page with personalized information
    (calendar/reminder function, picture, birthdate etc)
- sending and recieve short messages (called SMS for GSM phones)
    to/from other users if they have an account in my portal)
- sending little messages to other users (inbox/outbox - own
    messaging system, not based on pop/smtp!!!)
- creating own little "information channels" I mean messages that
    should be posted at the personlized site of other users if they
    supscript to these "information channels" from other users
- uploading pictures
- wide database searches, searching for other users and content
    (DBIx::Recordset :-)

> I work with Embperl in many projects and I don't see why it would not
> fit in yours. 

One of the most important things for me is the MVC - pardigm because
I want to separate content and logic. How can I implement this method
with embperl? (Because embperl is embedding perlcode in HTML) It's more
the JavaServerPages/Java Beans concept I prefer. Only snippets of 
perlcode in
my HTML and behind that the more logical stuff if needed.

> Some time ago someone posted the results of a performance
> comparison between Embperl, PHP, Mason and others (maybe someone can
> post it again).

I know that embperl performs very good and I know this
comparison because I read the mailinglist for about 1 year :-)
So I know that embperl's performance is really good (Thanx to gerald :-)

> Gerald have already said that Embperl 2 is ready for production
> systems.

I know this too but thanx for your information and feedback.
I appreciate :-) Any additional questions about the application, luiz?

Regards Oliver

-- 
  /"\		mailto:the.unchallenged@gmx.de
  \ /		http://www.the-unchallenged.de
   X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
  / \		


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Design decision / embperl or mason? :-)

Posted by "Luiz Fernando B. Ribeiro" <lu...@engenhosolucoes.com.br>.
Oliver,

What exactly do you mean by real big? Give some numbers and maybe some
of the list members may help.

I work with Embperl in many projects and I don't see why it would not
fit in yours. It's stable, powerful, easy to maintain, integrates with
Dreamweaver, etc...

Some time ago someone posted the results of a performance
comparison between Embperl, PHP, Mason and others (maybe someone can
post it again).

Gerald have already said that Embperl 2 is ready for production
systems.

Regards,

-- 
Luiz Fernando B. Ribeiro
Engenho Soluções para a Internet

Tuesday, March 23, 2004, 5:29:55 PM, você escreveu:

OB> Hello All,

OB> I'm planning to build a real real big web application
OB> which has more then 50 sites dynamical generated
OB> html and heavy load traffic.

OB> Now, I'm a bit confused choosing the right templating
OB> technology. Finally I see-saw between embperl and
OB> mason. So I want to know the advantages and dis-
OB> advantages concerning both technologies.

OB> I hope you don't feel offended about this question but
OB> I don't know a better place/group asking how to do
OB> get the right answers.

OB> By the way, I didn't ask any mason-guys, I post my
OB> question only to the embperl mailinglist because actual
OB> I made a little decision for embperl.

OB> I'm curious about your factual and objective comments
OB> and answers.

OB> Regards Oliver



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Design decision / embperl or mason? :-)

Posted by Oliver Brandt <th...@gmx.de>.
Hello All,

I'm planning to build a real real big web application
which has more then 50 sites dynamical generated
html and heavy load traffic.

Now, I'm a bit confused choosing the right templating
technology. Finally I see-saw between embperl and
mason. So I want to know the advantages and dis-
advantages concerning both technologies.

I hope you don't feel offended about this question but
I don't know a better place/group asking how to do
get the right answers.

By the way, I didn't ask any mason-guys, I post my
question only to the embperl mailinglist because actual
I made a little decision for embperl.

I'm curious about your factual and objective comments
and answers.

Regards Oliver

-- 
  /"\		mailto:the.unchallenged@gmx.de
  \ /		http://www.the-unchallenged.de
   X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
  / \		


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org