Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 38207 invoked from network); 27 Jul 2010 19:48:17 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Jul 2010 19:48:17 -0000 Received: (qmail 70488 invoked by uid 500); 27 Jul 2010 19:48:16 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 70441 invoked by uid 500); 27 Jul 2010 19:48:16 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 70434 invoked by uid 99); 27 Jul 2010 19:48:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jul 2010 19:48:16 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of smithm@gmail.com designates 74.125.82.53 as permitted sender) Received: from [74.125.82.53] (HELO mail-ww0-f53.google.com) (74.125.82.53) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jul 2010 19:48:09 +0000 Received: by wwb13 with SMTP id 13so641416wwb.22 for ; Tue, 27 Jul 2010 12:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=6Zoa1umCfDKJy89Zx9VM6AUZ2Z3eb+/ARDhGcP0YwGE=; b=YzykAXdKQa8lvQQ5/rV27gmzATGvCi0iTkMNh7OxIsL7+LfpEvvPrgy2gbjhmXGZ6Q mZpF68l40/kHvnQzn9msBVDnWrt2+tkty72B8skGdjwsIhc4EdaVBxPHh3FDxZmwiqwf RkayMQczszV/e57O8t2MzM05icnLSOF8iWZwY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=fxM9SqznnHDFu3SgDC3Ko8TQVIoNJ27S3hwu3oa4N3MqRqiP9pHiYrKabRkYCZYkYZ S887iJZdcbEldnYmrCXmQakZ9cs7enokvAc/JOBbgLAw5y8S5L+GpoWIHwY171rs1FWH Qv1shh2T0HsXsBfHByVIhgrXfQxVE0wAdP1k0= Received: by 10.227.158.1 with SMTP id d1mr9263325wbx.110.1280260064319; Tue, 27 Jul 2010 12:47:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.16.40 with HTTP; Tue, 27 Jul 2010 12:47:24 -0700 (PDT) In-Reply-To: References: From: Michael Smith Date: Tue, 27 Jul 2010 20:47:24 +0100 Message-ID: Subject: Re: @param seems to be shared between Execute calls To: Gerald Richter - ECOS Cc: embperl@perl.apache.org, Michael Stevens , cabell.demarcellus@dianomi.com, Michael Smith Content-Type: multipart/related; boundary=0016363b97a05add6c048c63c630 X-Virus-Checked: Checked by ClamAV on apache.org --0016363b97a05add6c048c63c630 Content-Type: multipart/alternative; boundary=0016363b97a05add67048c63c62f --0016363b97a05add67048c63c62f Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thank you Gerald and Andrew - that's most helpful and much appreciated Michael On Mon, Jul 26, 2010 at 9:06 AM, Gerald Richter - ECOS < gerald.richter@ecos.de> wrote: > Hi Michael, > > > > one way of figuring out if it was called through Execute is to use the > caller funtction of Perl. > > > > The other one you can try it to use sub_req: > > > > sub_req > > top > > > > [image: http://www.ecos.de/embperl/images/but.gif] > > Method: > > > > $component -> sub_req *[read only]* > > [image: http://www.ecos.de/embperl/images/transp.gif] > > [image: http://www.ecos.de/embperl/images/but.gif] > > Since: > > > > 2.0b6 > > [image: http://www.ecos.de/embperl/images/transp.gif] > > True is this is not the outermost Embperl component, i.e. this component = is > called from within another component. > > > > Gerald > > > > > > > > *From:* Michael Smith [mailto:smithm@gmail.com] > *Sent:* Friday, July 23, 2010 12:25 AM > *To:* Gerald Richter - ECOS > *Cc:* embperl@perl.apache.org; Michael Stevens; > cabell.demarcellus@dianomi.com; Michael Smith > > *Subject:* Re: @param seems to be shared between Execute calls > > > > Thanks Gerald, > > > > That's good to know for the future. Is there a way to know if the code h= as > been called through Execute? I am actually using the same code both > directly and via Execute. > > > > Michael > > On Wed, Jul 21, 2010 at 10:19 AM, Gerald Richter - ECOS < > gerald.richter@ecos.de> wrote: > > Hi Michael, > > > > @param is only intented to be used to pass parameters to Execute. Setting > it directly might work or might not=85 > > > > If you want to share data inside a request use > > > > $epreq -> {test} =3D 1 ; > > > > The hash of $epreq is not used by Embperl itself, so you are free to use = it > and it exists exactly for the live time of one Apache request > > > > Gerald > > > > > > > > *From:* Michael Smith [mailto:smithm@gmail.com] > *Sent:* Wednesday, July 21, 2010 11:05 AM > > > *To:* embperl@perl.apache.org > > *Cc:* Michael Stevens; cabell.demarcellus@dianomi.com; Michael Smith > *Subject:* Re: @param seems to be shared between Execute calls > > > > My problem is slightly different - though possibly a manifestation of the > same thing. I find that param isn't cleaned up between requests. > > > > I have two epl files: > > > > set.epl: > > [- $param[0]->{'test'} =3D 1 -] > > > > get.epl > > [+ Dumper(@param) +] > > > > I find that the data from set.epl turns up when I make a subsequent reque= st > for get.epl (in practice it's a bit more random than that if one is runni= ng > multiple processes, so I make a few requests for set.epl and then a few f= or > get.epl) > > > > This only seems to be relevant if I reference param in the epl file I am > calling directly. If I reference it in epl files which are loaded in by > Execute, then they do appear to get cleaned up. > > > > Michael > > > > > > On Tue, Jul 20, 2010 at 10:20 PM, Ed Grimm wrote: > > Note that, under Apache, the cleanup code happens at the end of each > request - each of which could have dozens of Execute calls, between which= it > is very definitely NOT called. > > I have not used Embperl much from within server scripts, but in my limite= d > use there, I've never seen the cleanup code fire. I suspect each script = is > considered 'a request' for the purposes of the cleanup code (well, as far= as > docs are concerned. I don't know if the code actually fires on END.) > > -- > Ed Grimm > Identity Services > > From: > > Michael Stevens > > To: > > embperl@perl.apache.org > > Cc: > > Michael Smith , cabell.demarcellus@dianomi.com > > Date: > > 07/20/2010 10:12 AM > > Subject: > > @param seems to be shared between Execute calls > > > ------------------------------ > > > > > Hi. > > We're seeing an odd bug where @param seems to be shared between Execute > calls in the same process. The following code is a test case for this: > > #!/usr/bin/perl -w > > use strict; > use Embperl; > > my $output1; > > my $input =3D '[- $param[0]->{hello} =3D 42; -]'; > > Embperl::Execute({ > inputfile =3D> "blah", > input =3D> \$input, > output =3D> \$output1, > }); > > my $output2; > my $input2 =3D '[- use Data::Dumper; print Dumper(\@param); -]'; > > Embperl::Execute({ > inputfile =3D> "blah", > input =3D> \$input2, > output =3D> \$output2 > }); > > Which on my machine outputs: > > $VAR1 =3D [ > { > 'hello' =3D> 42 > } > ]; > > Surely this shouldn't happen? > > -- > Michael Stevens > Dianomi Ltd > 18 Buckingham Gate > London SW1E 6LB > > Tel: 020 7802 5530 > Fax: 020 7630 7356 > www.dianomi.com > > The information in this message and any attachment is intended for the > addressee and is confidential and may be subject to legal privilege. > Dianomi Ltd, Registered Office: One America Square, Crosswall, London. > EC3N 2SG. Registered in England and Wales with Company Registration > Number 4513809. VAT registration number: 809754988 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org > For additional commands, e-mail: embperl-help@perl.apache.org > > > > > --0016363b97a05add67048c63c62f Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thank you Gerald and Andrew - that's most helpful and much appreciated<= br>
Michael

On Mon, Jul 26, 2010 at 9:= 06 AM, Gerald Richter - ECOS <gerald.richter@ecos.de> wrote:

Hi Michael,

=A0

one way of figuring out if it was called through Execu= te is to use the caller funtction of Perl.

=A0

The other one you can try it to use sub_req:

=A0

sub_req

top

=A0

=A0

Method:

=A0

$component -> sub_req [= read only]

=A0

Since:

=A0

2.0b6

True is this is not the outermo= st Embperl component, i.e. this component is called from within another component.

=A0

Gerald

=A0

=A0

=A0

From:= Michael Smith [mailto:smithm@gmail.= com]
Sent: Friday, July 23, 2010 12:25 AM
To: Gerald Richter - ECOS
Cc: emb= perl@perl.apache.org; Michael Stevens; cabell.= demarcellus@dianomi.com; Michael Smith


Subject: Re: @param seems to be shared between Execute calls

=A0

Thanks Gerald,

=A0

That's good to know for the future. =A0Is there = a way to know if the code has been called through Execute? =A0I am actually using th= e same code both directly and via Execute.

=A0

Michael

On Wed, Jul 21, 2010 at 10:19 AM, Gerald Richter - E= COS <gerald.= richter@ecos.de> wrote:

Hi Michael,

=A0

@param is only intented to be used to pass parameters to Execute. Setting it directly might work or might not=85

=A0

If you want to share data inside a request use

=A0

=A0$epreq -> {test} =3D 1 ;

=A0

The hash of $epreq is not used by Embperl itself, so you are free to use it and it exists exactly for= the live time of one Apache request

=A0

Gerald

=A0

=A0

=A0

=A0

My problem is slightly different - though possibly a manifestation of the same thing. =A0I find that param isn't cleaned up between requests.

=A0

I have two epl files:

=A0

set.epl:

[- $param[0]->{'test'} =3D 1 -]

=A0

get.epl

[+ Dumper(@param) +]

=A0

I find that the data from set.epl turns up when I make a subsequent request f= or get.epl (in=A0practice=A0it's a bit more random than that if one is running multiple processes, so I make a few requests for set.epl and then a= few for get.epl)

=A0

This only seems to be relevant if I reference param in the epl file I am calling directly. =A0If I reference it in epl files which are loaded in by Execute, then they do appear to get cleaned up.

=A0

Michael

=A0

=A0

On Tue, Jul 20, 2010 at 10:20 PM, Ed Grimm <ed_grimm@raytheon.com> wrote:

Note that, under Apache, the cleanup code happens at the end of each request - each of which could have dozens of Execute calls, between which it is very definitely NOT called.

I have not used Embperl much from within s= erver scripts, but in my limited use there, I've never seen the cleanup code = fire. =A0I suspect each script is considered 'a request' for the purposes= of the cleanup code (well, as far as docs are concerned. =A0I don't know if th= e code actually fires on END.)

--
Ed Grimm
Identity Services

From:

Michael Stevens = <michae= l.stevens@dianomi.com>

To:

embperl@perl.apache.org

Cc:

Michael Smith &l= t;michael.sm= ith@dianomi.com>, cabel= l.demarcellus@dianomi.com

Date:

07/20/2010 10:12= AM

Subject:

@param seems to = be shared between Execute calls

=A0





Hi.

We're seeing an odd bug where @param seems to be shared between Exe= cute
calls in the same process. The following code is a test case for this:<= /tt>

#!/usr/bin/perl -w

use strict;
use Embperl;

my $output1;

my $input =3D '[- $param[0]->{hello} =3D 42; -]';

Embperl::Execute({
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 inputfile =3D> "blah",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 input =3D> \$input,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 output =3D> \$output1,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 });

my $output2;
my $input2 =3D '[- use Data::Dumper; print Dumper(\@param); -]'= ;

Embperl::Execute({
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0inputfile =3D> "blah",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0input =3D> \$input2,
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0output =3D> \$output2
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 });

Which on my machine outputs:

$VAR1 =3D [
=A0 =A0 =A0 =A0 =A0 {
=A0 =A0 =A0 =A0 =A0 =A0 'hello' =3D> 42
=A0 =A0 =A0 =A0 =A0 }
=A0 =A0 =A0 =A0 ];

Surely this shouldn't happen?

--
Michael Stevens
Dianomi Ltd
18 Buckingham Gate
London SW1E 6LB

Tel: 020 7802 5530
Fax: 020 7630 7356
www.dianomi.com

The information in this message and any attachment is intended for the =
addressee and is confidential and may be subject to legal privilege.
Dianomi Ltd, Registered Office: One America Square, Crosswall, London. =
EC3N 2SG. Registered in England and Wales with Company Registration
Number 4513809. VAT registration number: 809754988

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

=A0

=A0


--0016363b97a05add67048c63c62f-- --0016363b97a05add6c048c63c630 Content-Type: image/png; name="image002.png" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: c271a4f276a4f91_0.1.2 iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAMAAACeL25MAAAAAXNSR0ICQMB9xQAAAANQTFRFAAAA p3o92gAAAAF0Uk5TAEDm2GYAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAZdEVYdFNvZnR3YXJlAE1p Y3Jvc29mdCBPZmZpY2V/7TVxAAAAC0lEQVQY02NgwAQAABQAAUKb1PsAAAAASUVORK5CYII= --0016363b97a05add6c048c63c630 Content-Type: image/gif; name="image001.gif" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: c271a4f276a4f91_0.1.1 R0lGODlhCQALALMAAC16pOPt8oezy7/W4lSTtf///zuDqmSdvP4BAgAAAAAAAAAAAAAAAAAAAAAA AAAAACH5BAQUAP8ALAAAAAAJAAsAAAQlsMgixpwDkFuCMYBwHcAHWFT5fUG2rpugroFEmmhnile2 cZRcBAA7 --0016363b97a05add6c048c63c630--