Mailing List Archive

Refresh oddity...
I have a form that allows users to enter in one or more entries into my
db.

If there exists entries in the database a small table is suppose to be
display the contents of a hash at the top of the form that would enable
the user to check a box and remove entry.

The problem that I'm having is when the user wishes to enter another
entry... The initial form data is correctly stored however the table,
which should show this new entry, is not displayed (it is if I click on
a link or hit refresh)

To handle the toggling I simply do:

[$ if scalar(keys %HASH) > 0 $]
table stuff....
[$ endif $]

The very odd thing is it appears that scalar(keys %HASH) remains the
same and won't update unless I click on a link or hit refresh (even if I
do an 'undef %HASH' prior to loading it with data)...
--
__________________________________________________________
Mr. Erich L. Markert emarkert@pace.edu
Computer Learning Center TEL (914)422-4328
Pace University
1 Martine Ave
White Plains, New York 10606-1932

Those who do not understand Unix are condemned to reinvent it, poorly.
-- Henry Spencer
RE: Refresh oddity... [ In reply to ]
>
> The very odd thing is it appears that scalar(keys %HASH) remains the
> same and won't update unless I click on a link or hit refresh (even if I
> do an 'undef %HASH' prior to loading it with data)...

Maybe the page isn't executed, but served from some cache. You may check
your embperl.log file to see, if the page is really executed when you expect
it.

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 925151
WWW: http://www.ecos.de Fax: +49 6133 925152
-------------------------------------------------------------
Re: Refresh oddity... [ In reply to ]
Hmm... I changed my httpd.conf so embperl has virtlog set and the
dbgLogLink option enabled.

I run this page and, if I'm reading the output correctly, it appears
that it is indeed getting this from cache. Evals: 661 Cache: 661 (100%)

Is there anyway to tell embperl to disable caching on a page by page
basis? I don't want to turn it off for my entire site but only for
certain situations.

Gerald Richter wrote:
>
> >
> > The very odd thing is it appears that scalar(keys %HASH) remains the
> > same and won't update unless I click on a link or hit refresh (even if I
> > do an 'undef %HASH' prior to loading it with data)...
>
> Maybe the page isn't executed, but served from some cache. You may check
> your embperl.log file to see, if the page is really executed when you expect
> it.
>
> 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 925151
> 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

--
__________________________________________________________
Mr. Erich L. Markert emarkert@pace.edu
Computer Learning Center TEL (914)422-4328
Pace University
1 Martine Ave
White Plains, New York 10606-1932

Those who do not understand Unix are condemned to reinvent it, poorly.
-- Henry Spencer
RE: Refresh oddity... [ In reply to ]
>
> Hmm... I changed my httpd.conf so embperl has virtlog set and the
> dbgLogLink option enabled.
>
> I run this page and, if I'm reading the output correctly, it appears
> that it is indeed getting this from cache. Evals: 661 Cache: 661 (100%)
>

No, this only means that the precompiled Perl code is used, but the whole
page has been executed. The question is, if you see the old values, is the
page really executed or do you see just the cached page (which would mean
that the link to the log file is also cached and you will get the old
logfile entrys). You may simply look at the time stamps at the start and end
of the logfile. Do they change, when you get the page with the old values?

Gerald
Re: Refresh oddity... [ In reply to ]
Well the timestamps are different. Here's the head portion of the
logfile:

Logfile = /tmp/embperl.log, Position = 4150760, Pid = 3714
[3714]REQ: Embperl 1.2.1 starting... Fri May 26 08:55:49 2000

[3714]REQ: No Safe Eval All Opcode allowed mode = mod_perl (3)
[3714]REQ: Package = HTML::Embperl::DOC::_1
[3714]Formdata... length = 395


Tail:

[3714]PERF: Time: 640 ms Evals: 661 Cache Hits: 637 (96%)
[3714]Request finished. Fri May 26 08:55:50 2000

But even though the times are different it seems that the code is not
being executed properly. With this last test I accessed the page. I
had one entry listed in this table. I then checked remove and clicked
on the submit button. I then checked the logfile and found the
following:

[3714]EVAL< scalar(keys %RELATIVES) > 0
[3714]EVAL> 1

If this page were executing properly this should have eval'd to 0 since
there were no relatives left.

One oddity I noticed yesterday... If I fill out the form and click "Add
Another" this new entry isn't immediately shown. If I then fill out the
form and click "Add Another" the previous record is shown. This is
consistent. It seems that it's always one relative behind.

Gerald Richter wrote:
>
> >
> > Hmm... I changed my httpd.conf so embperl has virtlog set and the
> > dbgLogLink option enabled.
> >
> > I run this page and, if I'm reading the output correctly, it appears
> > that it is indeed getting this from cache. Evals: 661 Cache: 661 (100%)
> >
>
> No, this only means that the precompiled Perl code is used, but the whole
> page has been executed. The question is, if you see the old values, is the
> page really executed or do you see just the cached page (which would mean
> that the link to the log file is also cached and you will get the old
> logfile entrys). You may simply look at the time stamps at the start and end
> of the logfile. Do they change, when you get the page with the old values?
>
> Gerald

--
__________________________________________________________
Mr. Erich L. Markert emarkert@pace.edu
Computer Learning Center TEL (914)422-4328
Pace University
1 Martine Ave
White Plains, New York 10606-1932

Those who do not understand Unix are condemned to reinvent it, poorly.
-- Henry Spencer
RE: Refresh oddity... [ In reply to ]
>
> One oddity I noticed yesterday... If I fill out the form and click "Add
> Another" this new entry isn't immediately shown. If I then fill out the
> form and click "Add Another" the previous record is shown. This is
> consistent. It seems that it's always one relative behind.
>

It's very hard to help you more without to see the code (also I will not
have the time to review huge junks of code), but I guess there is an error
somewhere in the logic of your page. Are you able to make a small example
that shows what happen, so we can review it here?

Gerald
Re: Refresh oddity... [ In reply to ]
Update...

How do you spell idiot? E-R-I-C-H

The refresh oddity isn't an embperl problem but the nut behind my
keyboard....

The reason why the refresh wasn't behaving properly was a logic error...
I was populating the hash prior to doing the data updates. Hence, the
hash was always one record behind (something I found out yesterday)...

One thing I did learn about was a very nice feature - VIRTLOG. Enable
that and then set EMBPERL_DEBUG equal to 10477... This adds links to
the embperl log file, doc source only, and doc eval....

Thanks Gerald for the help.