Mailing List Archive

Strange behavior in Embperl
Hi Friends,
I have installed embperl on my VPS and i am experiencing strange behavior of
it.
1. The errors located by it is not in same line number as told by the error.
2. A very strnage behavoir is :
I have this code in executed in base.epl
--base.epl
.....
[- Execute ('announcement_temp1.epl') -]
.....
--announcements_temp1.epl

<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber3">
<tr>
<td width="100%" align="left"
valign="top"><b>Announcements:</b>
<font size="2" > <a href="javascript:collapse_announce.slideit()">Show /
Hide</a> </font></p>
[- $r=shift;
# print Dumper $r->{announcements};
-]
<div id="announce">
[$ foreach $row (@{$r->{announcements}}) $]
<b>[+ $row->[1] +]</b>
&nbsp;&nbsp;&nbsp;
[+ $row->[0] +]
<br>
[- $r->{expanded} = 'block'; -]

[$ endforeach $]
</div>
<script type="text/javascript">

//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec,
enablepersist(true/fase), [initialstate] )
var collapse_announce=new animatedcollapse("announce", 1000, false,'[+
$r->{expanded} +]')

</script>

</td>
</tr>


</table>

--------------------
Now in the output i have multiple lines of html starting from <tr>
...........</tr>.
Is my installation of embperl not correct or what.
I am running Centos 4.5 with modperl and httpd installed via yum and Embperl
on force install on CPAN shell.

Awaiting quick responses as i am stuck,
Thanks,
Abhishek jain
RE: Strange behavior in Embperl [ In reply to ]
Hi,

$row has a special meaning in Embperl (see
http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_8)

So in your case, replace $row by any other variable name and it should
work

Gerald


> -----Original Message-----
> From: abhishek jain [mailto:mail@ejain.com]
> Sent: Tuesday, January 01, 2008 6:48 AM
> To: embperl@perl.apache.org
> Subject: Strange behavior in Embperl
>
> Hi Friends,
> I have installed embperl on my VPS and i am experiencing
> strange behavior of it.
> 1. The errors located by it is not in same line number as
> told by the error.
> 2. A very strnage behavoir is :
> I have this code in executed in base.epl --base.epl .....
> [- Execute ('announcement_temp1.epl') -] .....
> --announcements_temp1.epl
>
> <table border="1" cellpadding="0" cellspacing="0"
> style="border-collapse: collapse" bordercolor="#111111"
> width="100%" id="AutoNumber3">
> <tr>
> <td width="100%" align="left"
> valign="top"><b>Announcements:</b>
> <font size="2" > <a
> href="javascript:collapse_announce.slideit()">Show / Hide</a>
> </font></p>
> [- $r=shift;
> # print Dumper $r->{announcements};
> -]
> <div id="announce">
> [$ foreach $row (@{$r->{announcements}}) $]
> <b>[+ $row->[1] +]</b>
> &nbsp;&nbsp;&nbsp;
> [+ $row->[0] +]
> <br>
> [- $r->{expanded} = 'block'; -]
>
> [$ endforeach $]
> </div>
> <script type="text/javascript">
>
> //Syntax: var uniquevar=new animatedcollapse("DIV_id",
> animatetime_milisec, enablepersist(true/fase), [initialstate]
> ) var collapse_announce=new animatedcollapse("announce",
> 1000, false,'[+ $r->{expanded} +]')
>
> </script>
>
> </td>
> </tr>
>
>
> </table>
>
>
> --------------------
> Now in the output i have multiple lines of html starting from
> <tr> ...........</tr>.
> Is my installation of embperl not correct or what.
> I am running Centos 4.5 with modperl and httpd installed via
> yum and Embperl on force install on CPAN shell.
>
> Awaiting quick responses as i am stuck,
> Thanks,
> Abhishek jain
>
>

** Virus checked by BB-5000 Mailfilter **

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Strange behavior in Embperl [ In reply to ]
Hi Gerald,
Thanks it did worked , now another problem :)
At times when i click on a url running on embperl either correct page will
come, or an error message will come that "[9272]ERR: 24: Error in Perl code:
Can't call method "disconnect" on an undefined value at /home/xxx/abc.html
line xxx"
Also sometimes blank page will come .

Also at times mysql too many connections errror is observed , i am using
simple DBI and cannot change that i need $dbh for one of the library used in
my code uses it. I am closing by $dbh->disconnect and there is no error
in errstr i believe.

Can you help.
Thanks,
Abhishek jain


On 1/1/08, Gerald Richter - ECOS GmbH <richter@ecos.de> wrote:
>
> Hi,
>
> $row has a special meaning in Embperl (see
> http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_8)
>
> So in your case, replace $row by any other variable name and it should
> work
>
> Gerald
>
RE: Re: Strange behavior in Embperl [ In reply to ]
Hi,

I would suggest using Apache::DBI, which will take care of shareing db
handles

Gerald


> -----Original Message-----
> From: abhishek jain [mailto:mail@ejain.com]
> Sent: Wednesday, January 02, 2008 4:20 AM
> To: Gerald Richter
> Cc: embperl@perl.apache.org
> Subject: Re: Strange behavior in Embperl
>
> Hi Gerald,
> Thanks it did worked , now another problem :) At times when i
> click on a url running on embperl either correct page will
> come, or an error message will come that "[9272]ERR: 24:
> Error in Perl code: Can't call method "disconnect" on an
> undefined value at /home/xxx/abc.html line xxx"
> Also sometimes blank page will come .
>
> Also at times mysql too many connections errror is observed ,
> i am using simple DBI and cannot change that i need $dbh for
> one of the library used in my code uses it. I am closing by
> $dbh->disconnect and there is no error in errstr i believe.
>
> Can you help.
> Thanks,
> Abhishek jain
>
>
> On 1/1/08, Gerald Richter - ECOS GmbH <richter@ecos.de> wrote:
>
> Hi,
>
> $row has a special meaning in Embperl (see
>
> http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#se
> ct_8
> <http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_8> )
>
> So in your case, replace $row by any other variable
> name and it should
> work
>
> Gerald
>
>
>

** Virus checked by BB-5000 Mailfilter **

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Re: Strange behavior in Embperl [ In reply to ]
Thanks again Gerald, appreciated.
What about the problem , at times i observe a blank page, i believe that $r
= shift does not give me the value of $r . If i refresh the page at times
need to do that twice than it shows the correct page. My server has free
resources . Is it the case that i need to change the setting of Apache , if
it is that what but i am running other sites also but this problem is with
the embperl only.
Thanks,
Abhishek jain


On 1/2/08, Gerald Richter - ECOS GmbH <richter@ecos.de> wrote:
>
> Hi,
>
> I would suggest using Apache::DBI, which will take care of shareing db
> handles
>
> Gerald
>
>
> > -----Original Message-----
> > From: abhishek jain [mailto:mail@ejain.com]
> > Sent: Wednesday, January 02, 2008 4:20 AM
> > To: Gerald Richter
> > Cc: embperl@perl.apache.org
> > Subject: Re: Strange behavior in Embperl
> >
> > Hi Gerald,
> > Thanks it did worked , now another problem :) At times when i
> > click on a url running on embperl either correct page will
> > come, or an error message will come that "[9272]ERR: 24:
> > Error in Perl code: Can't call method "disconnect" on an
> > undefined value at /home/xxx/abc.html line xxx"
> > Also sometimes blank page will come .
> >
> > Also at times mysql too many connections errror is observed ,
> > i am using simple DBI and cannot change that i need $dbh for
> > one of the library used in my code uses it. I am closing by
> > $dbh->disconnect and there is no error in errstr i believe.
> >
> > Can you help.
> > Thanks,
> > Abhishek jain
> >
> >
> > On 1/1/08, Gerald Richter - ECOS GmbH <richter@ecos.de> wrote:
> >
> > Hi,
> >
> > $row has a special meaning in Embperl (see
> >
> > http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#se
> > ct_8
> > <http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_8> )
> >
> > So in your case, replace $row by any other variable
> > name and it should
> > work
> >
> > Gerald
> >
> >
> >
>
> ** Virus checked by BB-5000 Mailfilter **
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
>
>
RE: Re: Strange behavior in Embperl [ In reply to ]
One important thing to note when using Apache::DBI to share connections
is that you should not create a connection pool when apache starts up,
otherwise you will have multiple apache requests sharing the same DB
handles. I have seen some really nasty side effects to this where data
from one process is returned to another.



________________________________

From: webbee.biz@gmail.com [mailto:webbee.biz@gmail.com] On Behalf Of
abhishek jain
Sent: January 2, 2008 2:59 PM
To: Gerald Richter - ECOS GmbH
Cc: embperl@perl.apache.org
Subject: Re: Re: Strange behavior in Embperl



Thanks again Gerald, appreciated.

What about the problem , at times i observe a blank page, i believe that
$r = shift does not give me the value of $r . If i refresh the page at
times need to do that twice than it shows the correct page. My server
has free resources . Is it the case that i need to change the setting of
Apache , if it is that what but i am running other sites also but this
problem is with the embperl only.

Thanks,

Abhishek jain



On 1/2/08, Gerald Richter - ECOS GmbH <richter@ecos.de > wrote:

Hi,

I would suggest using Apache::DBI, which will take care of shareing db
handles

Gerald


> -----Original Message-----
> From: abhishek jain [mailto:mail@ejain.com]
> Sent: Wednesday, January 02, 2008 4:20 AM
> To: Gerald Richter
> Cc: embperl@perl.apache.org
> Subject: Re: Strange behavior in Embperl
>
> Hi Gerald,
> Thanks it did worked , now another problem :) At times when i
> click on a url running on embperl either correct page will
> come, or an error message will come that "[9272]ERR: 24:
> Error in Perl code: Can't call method "disconnect" on an
> undefined value at /home/xxx/abc.html line xxx"
> Also sometimes blank page will come .
>
> Also at times mysql too many connections errror is observed ,
> i am using simple DBI and cannot change that i need $dbh for
> one of the library used in my code uses it. I am closing by
> $dbh->disconnect and there is no error in errstr i believe.
>
> Can you help.
> Thanks,
> Abhishek jain
>
>
> On 1/1/08, Gerald Richter - ECOS GmbH < richter@ecos.de
<mailto:richter@ecos.de> > wrote:
>
> Hi,
>
> $row has a special meaning in Embperl (see
>
> http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#se
> ct_8
> < http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_8
<http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_8> > )
>
> So in your case, replace $row by any other variable
> name and it should
> work
>
> Gerald
>
>
>

** Virus checked by BB-5000 Mailfilter **

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Re: Strange behavior in Embperl [ In reply to ]
Hi,
I think i found part of the problem, actually i also see an entry into
httpd.conf that says segmentation fault when the blank page appears, may be
the process grows up on multiple req, if i do
MaxRequestsPerChild 1
It solves the problem, i do not know whether this is the right forum but any
idea why embperl is taking so much memory, i did refreshed the pages and
found it takes up to this much 19M right on third refresh of the page.
Also if i run on -X it stops on second refresh.
Any pointers?
Thanks a lot for help .
Abhishek jain


On 1/2/08, abhishek jain <mail@ejain.com> wrote:
>
> Thanks again Gerald, appreciated.
> What about the problem , at times i observe a blank page, i believe that
> $r = shift does not give me the value of $r . If i refresh the page at times
> need to do that twice than it shows the correct page. My server has free
> resources . Is it the case that i need to change the setting of Apache , if
> it is that what but i am running other sites also but this problem is with
> the embperl only.
> Thanks,
> Abhishek jain
>
>
> On 1/2/08, Gerald Richter - ECOS GmbH <richter@ecos.de > wrote:
> >
> > Hi,
> >
> > I would suggest using Apache::DBI, which will take care of shareing db
> > handles
> >
> > Gerald
> >
> >
> > > -----Original Message-----
> > > From: abhishek jain [mailto:mail@ejain.com]
> > > Sent: Wednesday, January 02, 2008 4:20 AM
> > > To: Gerald Richter
> > > Cc: embperl@perl.apache.org
> > > Subject: Re: Strange behavior in Embperl
> > >
> > > Hi Gerald,
> > > Thanks it did worked , now another problem :) At times when i
> > > click on a url running on embperl either correct page will
> > > come, or an error message will come that "[9272]ERR: 24:
> > > Error in Perl code: Can't call method "disconnect" on an
> > > undefined value at /home/xxx/abc.html line xxx"
> > > Also sometimes blank page will come .
> > >
> > > Also at times mysql too many connections errror is observed ,
> > > i am using simple DBI and cannot change that i need $dbh for
> > > one of the library used in my code uses it. I am closing by
> > > $dbh->disconnect and there is no error in errstr i believe.
> > >
> > > Can you help.
> > > Thanks,
> > > Abhishek jain
> > >
> > >
> > > On 1/1/08, Gerald Richter - ECOS GmbH < richter@ecos.de> wrote:
> > >
> > > Hi,
> > >
> > > $row has a special meaning in Embperl (see
> > >
> > > http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#se
> > > ct_8
> > > < http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_8>
> > )
> > >
> > > So in your case, replace $row by any other variable
> > > name and it should
> > > work
> > >
> > > Gerald
> > >
> > >
> > >
> >
> > ** Virus checked by BB-5000 Mailfilter **
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org
> >
> >
>
Re: Re: Strange behavior in Embperl [ In reply to ]
Hi Its me again,
But still the things are not working right.
I tried to recompile Embperl and put PerlModule Embperl after LoadModule
embperl_module ..............

Now i do not remember it was before or now but after i uncomment the
'PerlModule Embperl' line and things stop working i do not receieve
$r=shift; variable i mean $r = undef here.
Is it due to something i did during installation of embperl.
Also If i uncomment the line 'MaxRequestsPerChild 1' and comment 'PerlModule
Embperl ' then i recveive this line in error log
[Sun Jan 06 18:44:11 2008] [notice] child pid 30280 exit signal Segmentation
fault (11)

(May be error and page refreshes itself i mean the code produces output.)

and page appears , sometimes the same error appears twice and page does not
appears.

I am not sure have this error been encountered by someone else but things
are not working right for me . Also if someone wants i can mail the
Embperllogs to someone individually, i do not want to make the logs
public.
Pl help. I am working on the site http://delhi.pm.org/ it is the delhi perl
mongers site and people in this group have limited knowledge of embperl but
this will push up the embperl in Delhi .
--
Thanks
Abhishek jain



On 1/3/08, abhishek jain <mail@ejain.com> wrote:
>
> Hi,
> I think i found part of the problem, actually i also see an entry into
> httpd.conf that says segmentation fault when the blank page appears, may
> be the process grows up on multiple req, if i do
> MaxRequestsPerChild 1
> It solves the problem, i do not know whether this is the right forum but
> any idea why embperl is taking so much memory, i did refreshed the pages
> and found it takes up to this much 19M right on third refresh of the page.
> Also if i run on -X it stops on second refresh.
> Any pointers?
> Thanks a lot for help .
> Abhishek jain
>
>
> On 1/2/08, abhishek jain <mail@ejain.com> wrote:
> >
> > Thanks again Gerald, appreciated.
> > What about the problem , at times i observe a blank page, i believe that
> > $r = shift does not give me the value of $r . If i refresh the page at times
> > need to do that twice than it shows the correct page. My server has free
> > resources . Is it the case that i need to change the setting of Apache , if
> > it is that what but i am running other sites also but this problem is with
> > the embperl only.
> > Thanks,
> > Abhishek jain
> >
> >
> > On 1/2/08, Gerald Richter - ECOS GmbH <richter@ecos.de > wrote:
> > >
> > > Hi,
> > >
> > > I would suggest using Apache::DBI, which will take care of shareing db
> > > handles
> > >
> > > Gerald
> > >
> > >
> > > > -----Original Message-----
> > > > From: abhishek jain [mailto:mail@ejain.com]
> > > > Sent: Wednesday, January 02, 2008 4:20 AM
> > > > To: Gerald Richter
> > > > Cc: embperl@perl.apache.org
> > > > Subject: Re: Strange behavior in Embperl
> > > >
> > > > Hi Gerald,
> > > > Thanks it did worked , now another problem :) At times when i
> > > > click on a url running on embperl either correct page will
> > > > come, or an error message will come that "[9272]ERR: 24:
> > > > Error in Perl code: Can't call method "disconnect" on an
> > > > undefined value at /home/xxx/abc.html line xxx"
> > > > Also sometimes blank page will come .
> > > >
> > > > Also at times mysql too many connections errror is observed ,
> > > > i am using simple DBI and cannot change that i need $dbh for
> > > > one of the library used in my code uses it. I am closing by
> > > > $dbh->disconnect and there is no error in errstr i believe.
> > > >
> > > > Can you help.
> > > > Thanks,
> > > > Abhishek jain
> > > >
> > > >
> > > > On 1/1/08, Gerald Richter - ECOS GmbH < richter@ecos.de> wrote:
> > > >
> > > > Hi,
> > > >
> > > > $row has a special meaning in Embperl (see
> > > >
> > > > http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#se
> > > > ct_8
> > > > < http://perl.apache.org/embperl/pod/doc/Embperl.-page-3-.htm#sect_8>
> > > )
> > > >
> > > > So in your case, replace $row by any other variable
> > > > name and it should
> > > > work
> > > >
> > > > Gerald
> > > >
> > > >
> > > >
> > >
> > > ** Virus checked by BB-5000 Mailfilter **
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > > For additional commands, e-mail: embperl-help@perl.apache.org
> > >
> > >
> >
>