You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by masilva3 <ma...@terra.com.br> on 2002/06/17 06:14:53 UTC
"Buffering" output
Hi, mailing list Embperl,
I'd like now if is possible, when during the execution
of script.epl, if occur an error during processing
(type, error of database access), show other page with
the error formated, and not the page initially being build.
Considere, that that script.pl is of type:
<HTML>
[- commands - ] // in this moment an error occur
// and i'd like show other page,
// disregard this. (it's possible ?)
// It's similar when using CGI::out module
// in cgi for buffer output and flushout in
// any moment if desirable
</HTML>
Mauricio, Thank you
PS: My English is not very good
'
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
locale problem
Posted by "gerhard.egger" <ge...@lindeverlag.at>.
Hello all,
I'm using Embperl 1.3.4 on SuSE Linux.
As i've seen that Perl does not recognize my system's language setting
i've changed my Locale - Settings with 'export LC_ALL=de_AT@euro' in
/etc/profile.local - everything works fine now for normal perl-programs
- especially sorting special characters (umlaut).
But Apache and/or EmbPerl seems to ignore the changes i made.
I did try PassEnv SetEnv and PerlSetEnv in my http.conf.
What did I miss?
Thanks, Gerhard
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: "Buffering" output
Posted by Gerald Richter - ecos gmbh <ri...@ecos.de>.
>
> Ahha -- that's how I was trying to make it work. On the 2.0b8dev6 that
> you sent me Gerald, its seems that optReturnError now returns the 404
> when needed -- but I cannot get Embperl::Object to return a 500 -- even
> with the a 'die'.
>
With pure Embperl it work, with EO not yet, but it will be fixed in 2.0b8
which should be out during the next 3 days
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: "Buffering" output
Posted by Cameron McBride <ca...@cwru.edu>.
On Wed, Jun 19, 2002 at 09:18:02PM +0200, Gerald Richter wrote:
> You can use "die" to terminate the page and the Apache ErrorDocument for
> displaying a custom error page. Look at optReturnError in the docs
Ahha -- that's how I was trying to make it work. On the 2.0b8dev6 that
you sent me Gerald, its seems that optReturnError now returns the 404
when needed -- but I cannot get Embperl::Object to return a 500 -- even
with the a 'die'.
If I stick the 'die' in the '_base.epl', nothing gets returned (no error
doc). If the 'die' is in the page, it just stops processing and gets dumped:
=================
test.html (Embperl::Object page):
=================
[-
$req = shift;
die 'Error blah';
-]
Things to note: '[+ 1+2 +]'
=================
output:
=================
This is the template text
Things to note '<[+>1+2 '
=================
relevant mod_info
=================
Current Configuration:
conf/httpd.conf
Embperl_UseEnv off
EMBPERL_LOG /var/log/httpd/embperl.log
EMBPERL_SESSION_HANDLER_CLASS 'no'
EMBPERL_OPTIONS 262144
EMBPERL_DEBUG 10477
EMBPERL_OBJECT_BASE _base.epl
EMBPERL_URIMATCH (\.htm.?)
<Location /ep>
EMBPERL_APPNAME eptesting
EMBPERL_OBJECT_BASE _base.epl
EMBPERL_URIMATCH (\.htm.?)
</Location>
Is there a better way I can handle this? I know there was some
discussion about '$req -> component -> exit' back in the beginning of
May. Should I be using that? If so, it appears I would have to cascade
them.
As usual, responses are always appreciated!! TIA.
>> PS: My English is not very good
>
> No problem, mine isn't also the best :-)
heh, both of you are doing great. Try seeing the number of Ami's
(americans) that can communicate in other languages, let alone on a
technical support mailing list. Luckily, english is pretty popular... ;-)
You want to see not very good -- ask me to write a technical doc in
german, that would be something to laugh at. :p
Cameron
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: "Buffering" output
Posted by Gerald Richter <ri...@ecos.de>.
>I'd like now if is possible, when during the execution
>of script.epl, if occur an error during processing
>(type, error of database access), show other page with
>the error formated, and not the page initially being build.
Embperl per default buffers your output, before sending it to the browser.
You can use "die" to terminate the page and the Apache ErrorDocument for
displaying a custom error page. Look at optReturnError in the docs
Gerald
PS: My English is not very good
No problem, mine isn't also the best :-)
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: slow hashes with recursive loops?
Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
> I made a function to sort a folder list (with childs/parents), I know it
must be a silly method I use but it was the only one I could think of at the
time.
> The problem I now have is that is is very slow. I only have 128 folders
but it takes like 5 secs to loop through this.
>
> I have narrowed it down to the function below and I do not see the resaon
why it would be sooooooooooooooo slow.
Also I don't quite understand what you are doing here, it seems that you are
doing many many time the same sort, while the aruments to sort doesn't
change. At least I can't see in your code where you change %parentlist or
%node. So the first thing to do is to move these sort out of the loop and
perform them _before_ the loop, save the result in a array and use this as
argument to foreach. This should speed up your code many times (unless I
have overseen something). Maybe there are more constant operation that could
be moved out of the loop. Since I have to less knowlegde of your
datastructure, I can't say if there are more optimaziation possible.
> Then I remebered I read something about a bug or problem with embperl 2.x
and hashes. I cannot find it anymore but I use embperl 1.3b5 on redhat 7.2
(but same on redhat 6.1)
>
That has nothing to do with Perl hash. That was about some hashs that
Embperl 2 uses internaly and that only occurs if you have very huge
iteration of the same html code.
BTW. If you are using 1.3b5 I would recommend to update 1.3.4, but that's up
to you and has nothing to do with you problem.
Gerald
-------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 925131
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
slow hashes with recursive loops?
Posted by Hans de Groot <ha...@interspective.nl>.
Hi,
I made a function to sort a folder list (with childs/parents), I know it must be a silly method I use but it was the only one I could think of at the time.
The problem I now have is that is is very slow. I only have 128 folders but it takes like 5 secs to loop through this.
I have narrowed it down to the function below and I do not see the resaon why it would be sooooooooooooooo slow. specially if you considure I have many many hits on the database
and other silly this in the rest of the code. (It's for a website tool).
Then I remebered I read something about a bug or problem with embperl 2.x and hashes. I cannot find it anymore but I use embperl 1.3b5 on redhat 7.2 (but same on redhat 6.1)
Is there any work arround for this or something else I can do to speed things up? Right now I use $udat to store the tree list (ie I store the hashes in a string via join and every hit I split the string again into hashes.
It seems to me that this process shoudl take much longer jan just loop through that loop I made. But it's a hack and for now it works.
But people without cookies still get the slow version (Imagine 6 frames from which 3 use navigation is a 15 secs freeze.. )
Help
:-)
here my silly loop (note that the digit function does not take noticable time)
sub get_list()
{
my($tempparent)=shift;
my($step_size)=shift;
my($step_type)=shift;
my($subkey);
my($key);
$glob_lev++;
foreach $key (sort {$parentlist{$a} <=> $parentlist{$b}} keys %parentlist)
{
foreach $subkey (sort {$node{$a} <=> $node{$b}} keys %node)
{
if (($key eq $tempparent) && (exists $level{$tempparent,$subkey})) # deze node heeft child.
{
if ($glob_lev != $meet_lev)
{
$meet_lev=$glob_lev;
}
$count++;
$spacer="";
# Silly hash, 3 separate hashes for name, id, and level
$ruk=&digit($count,6);
$levelhash{$subkey}=$glob_lev;
$treehash{$ruk}=$spacer.$nodenaam{$subkey}; #Voor naam met indent
$parenthash{$ruk}=$key;
$key_hash{$ruk}=$subkey; # om de id terug te vinden
&get_list($subkey,$step_size,$step_type);
}
} # End for subkey
} #end for key
$glob_lev--;
}
Regards
Hans
------
Hans de Groot
Interspective Internet Services B.V.
Tel: +31 (0) 30 6001180
Fax +31 (0) 30 6044204
www: http://www.interspective.nl
email: hansg@interspective.nl
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: "Buffering" output
Posted by "Luiz Fernando B. Ribeiro" <li...@athome.pro.br>.
Oi Maurício,
Resposta a sua mensagem de segunda-feira, 17 de junho de 2002:
masilva3> Hi, mailing list Embperl,
masilva3> I'd like now if is possible, when during the execution
masilva3> of script.epl, if occur an error during processing
masilva3> (type, error of database access), show other page with
masilva3> the error formated, and not the page initially being build.
You can safely use eval {} or any of the error catching modules in
Embperl, I've been using the Error.pm to handle exceptions with
success in my projects.
Take a look at the Error.pm documentation in CPAN to see if it meet
your needs.
Reagards,
Luiz Fernando B. Ribeiro
Engenho Soluções para a Internet
luiz@engenhosolucoes.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org