Embperl vs. Mason

2000-02-14 Thread Andre Landwehr

Hi,
I made some pages with Embperl, but I don't know Mason. Yesterday
a friend told me of Mason, but he does not know Embperl very
well. Now I wonder about the pros and cons of each, not only in
respect to performance but also general usability, bugs etc.
What do more experienced web programmers than I am think about
Embperl or Mason?
btw: Is the new EmbperlObject somewhat comparable to Mason's
component model?

Thanks for your comments,
Andre



Re: Embperl and images on the same page

2000-01-31 Thread Andre Landwehr

On Mon, Jan 31, 2000 at 04:12:02PM +0100, Gerald Richter wrote:
> 
> PerlSetEnv EMBPERL_FILESMATCH "\.html"
> 

btw: Instead of EMBPERL_FILESMATCH I use a normal apache 
 section for this (with PerlHandler HTML::Embperl of
course), which works perfectly for me. Is there any reason to do
it this or the other way, or is it just personal taste?

Andre



Re: your mail

2000-01-31 Thread Andre Landwehr

On Fri, Jan 28, 2000 at 08:20:32PM +, [EMAIL PROTECTED] wrote:
> Check this :")
> http://www.fenrus.demon.nl/

Is someone trying to beat M$ at the Mindcraft benchmark after
all with this? ;-)

Andre



Re: overriding document root dynamically?

2000-01-29 Thread Andre Landwehr

On Fri, Jan 28, 2000 at 12:11:07PM -0800, Jonathan Swartz wrote:
> etc. I could do this with a set of virtual servers, but then I have to 
> change the httpd.conf and restart the server every time a user is
> added, which is undesirable.

Use mod_vhost_alias. You do not have to touch your httpd.conf for
a new user but just create a directory named like the server you
want, e.g. /home/httpd/www.joe.yourcompany.com/

Andre



Re: Apache::DBI and Sybase

2000-01-28 Thread Andre Landwehr

On Fri, Jan 28, 2000 at 03:56:00PM +0300, Vladimir Ivaschenko wrote:
> I have a trouble with Apache::DBI and Sybase under mod_perl (Embperl in
> this case). After some time calls to DBI->connect start to fail with
> message from CT-Lib - "Net-Library operation terminated due to
> disconnect". Maybe the ping() method from DBD::Sybase doesn't work? 

I can't help you with that problem but I can assure you that
ping() from DBD::Sybase does work.

Andre



Embperl: behaviour of [+ +] in foreach loops

2000-01-18 Thread Andre Landwehr

hi again,
just out of curiosity:
the output of the two following codesegments differs, in the way
that in the variant with [+ +] the value of $RAC_F is the same on
each line while in the [* *] variant the value changes as supposed.
Is there a reason for this, or is this just because of some scope
related technical problem?

--
[* foreach $RAC_F ( sort keys %USERS ) { *]


[* print "$USERS{$RAC_F}{forename} $USERS{$RAC_F}{lastname}"; *]

view

[* } *]
--
[* foreach $RAC_F ( sort keys %USERS ) { *]


[+$USERS{$RAC_F}{forename}+] [+$USERS{$RAC_F}{lastname}+]

view

[* } *]
--

Andre

btw: Gerald, thanks again for your quick help with that reordering 
 problem, I was able to fix my page in few minutes



Embperl optEarlyHttpHeader

2000-01-18 Thread Andre Landwehr

Hi,
if I set optEarlyHttpHeader (64) within my EMBPERL_OPTIONS my
page ist correctly shown in the browser. But if
optEarlyHttpHeader is not set, the contents of my page are mixed
up. I use several blocks of [- -] and [* *] and I execute two
Shellscripts using perls backtick-syntax (unfortunately I cannot
avoid this due to backward compatibility with other pages, those
scripts do some layout stuff). The different blocks of my page
get reordered and in between I see the HTTP-Headers. 

Can I avoid this reordering and ensure a correct display of my
page without having to do a major rewrite?

Thanks,
Andre



Re: Embperl + Apache::Session

2000-01-16 Thread Andre Landwehr

On Sun, Jan 16, 2000 at 03:37:51PM +0100, Gerald Richter wrote:
> This looks ok for the Embperl part, but if you have now staticly linked
> mod_perl you should throw out the LoadModule perl_module . I don't know
> what Apache does, if a module is staticly and dynamicly present, but this
> doesn't seems to be a good idea...

Wow, I don't believe it! It works now that I commented out the
LoadModule line! At least it does so for requests with lynx and
lwp-request, Netscape for some reason still does either not receive
or accept the cookie, but that should be a minor issue now.

Well, I think this is an unspecified if not even unreproducable
behaviour of apache I ran into here because of my blindness ;-). Many 
thanks for your help, especially Geralds!

Andre


 PGP signature


Re: Embperl + Apache::Session

2000-01-16 Thread Andre Landwehr

On Sun, Jan 16, 2000 at 01:50:09PM +0100, Gerald Richter wrote:
> > But I can also still see the session-id changing with
> > every reload, and no cookie is set, just like before.
> 
> What do you mean by session id? The number inside the square bracktes id the
> pid of the Apache child. Or do you mean other things?

I mean the ID saved as _session_id in %udat. I have a line "print
%udat;" in my page to check if that number changes.

> Please try to include the following output in your test page:
> 
> 1 = [+ ref (tied(%udat)) +]
> 2 = [+ ref (tied(%HTML::Embperl::udat)) +]
> 3 = [+ $Apache::Session::VERSION +]
> 4 = [+ $HTML::Embperl::Session::VERSION +]
> 
> what is the output of this?

1 = HTML::Embperl::Session 
2 = HTML::Embperl::Session 
3 = 1.04 
4 = 1.00 

Andre


 PGP signature


Re: How to make EmbPerl stuff new content into a existing frame?

2000-01-16 Thread Andre Landwehr

On Sat, Jan 15, 2000 at 01:16:06PM -0800, Scott Chapman wrote:
> I have a HTML document with two frames in it.  I need to make EmbPerl put a new
> html file (or content) into this frame.  This link in a regular HTML file does
> the trick but I don't want the user to have to hit a link to make this happen.
> 
> Update Frame
> 
> Can anyone tell me how to do this?  


I never did this myself but I think you should look at your
favourite Javascript documentation for this. Something about a
 in the first frame and a call to the "open"
method of your second frame should do. I don't know if you can
choose the frame for your output with Embperl or any other
serverbased language for that matter, since the browser requests
a page and displays it at the appropriate place.

Andre


 PGP signature


Re: Embperl + Apache::Session

2000-01-14 Thread Andre Landwehr

On Fri, Jan 14, 2000 at 01:31:17PM +0100, Gerald Richter wrote:
> What you describe looks good to me. There is one other issue, that is
> dynamlic linking mod_perl. How comes mod_perl into your Apache? Is it
> dynamicly loaded at runtime (i.e. by a LoadModule in your httpd.conf) or is
> it staticly loaded?
> 
> If the first is true, look if Embperl is loaded somewhere in your httpd.conf
> (either by a PerlModule or by a file that is loaded with PerlRequire).
> Remove this. In case of dynamicly linking Embperl must not loaded at startup
> time. (mod_perl will do this at request time for you)


I made a further test by now, with staticly linked mod_perl and without 
preloading HTML::Embperl in httpd.conf.

Doing a "tail -f /var/log/apache/error.log" I see "[11159]SES:
Embperl Session management enabled (1.xx)" (with the number
in brackets changing of course) every time I reload my
testpage. But I can also still see the session-id changing with
every reload, and no cookie is set, just like before.
Does the changing id not indicate that sessionmanagement is
basically working and there is just something terribly wrong with
the cookie part? Maybe I did not install some package from CPAN
correctly (although I cannot remember seeing any error
during installation)?

Andre


 PGP signature


Re: Embperl + Apache::Session

2000-01-14 Thread Andre Landwehr

On Fri, Jan 14, 2000 at 07:00:13AM +0100, Gerald Richter wrote:
> 
> You need to setup session handling at all, e.g.
> 
>  PerlSetEnv EMBPERL_SESSION_CLASSES "FileStore SysVSemaphoreLocker"

That is PerlSetEnv EMBPERL_SESSION_CLASSES "FileStore NullLocker"
in my httpd.conf

> When you restart your apache, you should see a message about EMbperl Session
> management enabled. Without this message it won't work

You talk about this one, don't you?
--
root@linbec31:/download/Perl/HTML-Embperl-1.2.1 #
/etc/rc.d/init.d/httpd start
[1392]SES:  Embperl Session management enabled (1.xx)
/etc/rc.d/init.d/httpd start: httpd started
--
I saw that message every time since I started playing around with
session handling, but despite the message it does not work


> You will only get the cookie header if you write to the %udat hash inside
> your page
I have done this, using the sample page implementing a counter posted
yesterday on this list. As I explained session management works
as far as generating the id and saving it into %udat, but it
simply does not set the cookie

Since this happens on two machines with at least slightly different Linux
distributions (one is Mandrake 6.0, the other a Redhat 5.2) I
think it is a configuration problem... so if someone could please
email me her complete configuration files I'd have more means to
test

Andre



Re: Embperl + Apache::Session

2000-01-13 Thread Andre Landwehr

On Thu, Jan 13, 2000 at 12:47:08PM -0800, Cliff Rayman wrote:
> 
> testing
> 
> This is my counter:
> [+ $udat{COUNTER}++ +]
> 
> 
> 
> 
> use your browser to view the page.
> keep hitting reload - counter should increase.

so my english was good enough to understand the documentation
after all... unfortunately the counter stays zero, no matter how
often I reload the page and no cookie is sent, as I suspected.
Could you please send me your complete apache configuration
files? Maybe it works with your files on my machines which would
give me a hint where to search...

Andre


 PGP signature


Re: or PerlTransHandler directive for multiple /user/subd ir/action

2000-01-13 Thread Andre Landwehr

On Thu, Jan 13, 2000 at 06:08:33AM -0500, Clifford Lang wrote:
> 
> Which is best or right one to use?
> 
> I have thousands of user directories, with a sub of admin for them to
> configure their site. 
> 
> >From the admin location I want to call the "config" (module e.g.
> www.here.com/user/admin/config)
> 

There are examples for doing this with mod_rewrite which is maybe
the most simple solution. Look at
http://www.apache.org/docs/mod/mod_rewrite.html

Take care,
Andre



Re: Embperl + Apache::Session

2000-01-13 Thread Andre Landwehr

On Wed, Jan 12, 2000 at 11:12:53AM -0800, Cliff Rayman wrote:
> i am using embperl with cookies.
> i also have this set in httpd.conf
> 
> PerlSetEnv EMBPERL_COOKIE_DOMAIN .genwax.com
> PerlSetEnv EMBPERL_COOKIE_PATH /
> PerlSetEnv EMBPERL_COOKIE_EXPIRES 'Friday, 31-Dec-2010 14:00:00 GMT'
> 
> how are you checking to make sure cookies are sent?
> 
> lwp-request -e 'http://www.domain.com/path/to/page/with/embperl|less
> 
> You should see a SET-COOKIE header.

I inserted those lines above into my httpd.conf, and did the
lwp-request. All headers I do see are the following:

Connection: close
Date: Thu, 13 Jan 2000 14:39:53 GMT
Server: Apache/1.3.9 (Unix) mod_perl/1.21 PHP/3.0.12
Content-Type: text/html
Client-Date: Thu, 13 Jan 2000 14:39:53 GMT
Client-Peer: 145.228.112.103:80
Title: sessiontest 1


Can you please send me a simple testpage for this, maybe I do
something wrong in my embperl code... I have only begun with perl
6 weeks ago or so and I still have not understood all mystiques
;-)

Take care,
Andre



Embperl + Apache::Session

2000-01-12 Thread Andre Landwehr

Hi,
I am trying to use sessionmanagement via Apache::Session together
with HTML::Embperl. As I understand from  the documentation I
just need to configure a storing and a locking mechanism in
httpd.conf to do so. After that I should be able to use the %udat
hash to store session related data, HTML::Embperl::Session is
supposed to do everything from creating a unique session-id to
storing it in a cookie or retrieving that cookie again
automatically. 
Unfortunately setting the cookie does not work for me. When I use
%udat for the first time a session-id is created (which I checked
with a simple "print %udat;"), but the cookie is not sent (and:
yes, my Netscape is cookie-enabled...). This is the embperl
related stuff from my httpd.conf: 

--
AddType text/html .epl
SetEnv EMBPERL_DEBUG 10477
SetEnv EMBPERL_VIRTLOG /perldebug
SetEnv EMBPERL_ESCMODE 0
# optRawInput + optRedirectStdout
SetEnv EMBPERL_OPTIONS 16914

# Session management
PerlSetEnv EMBPERL_SESSION_CLASSES "MemoryStore NullLocker"
PerlModule HTML::Embperl


SetHandler perl-script
PerlHandler HTML::Embperl
Options ExecCGI


SetHandler perl-script
PerlHandler HTML::Embperl
Options ExecCGI

---

I use the following versions:
Apache_1.3.9
Apache-Session-1.04
HTML-Embperl-1.2.1
libwww-perl-5.43
URI-1.02
HTML-Parser-2.23

I would be happy if someone could help me with that since I have tried
for two days everytime with the same result, which gets quite
depressing by now ;-) 


Btw: To my mind Embperl is really great! I ported a site from PHP to
Embperl recently and gained about 80% speed with that, due to
faster database access

Take care,
Andre


 PGP signature