Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 30863 invoked from network); 22 Jul 2010 22:25:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 22 Jul 2010 22:25:28 -0000 Received: (qmail 48802 invoked by uid 500); 22 Jul 2010 22:25:28 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 48736 invoked by uid 500); 22 Jul 2010 22:25:27 -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 48729 invoked by uid 99); 22 Jul 2010 22:25:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jul 2010 22:25:27 +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; Thu, 22 Jul 2010 22:25:20 +0000 Received: by wwb24 with SMTP id 24so4125215wwb.22 for ; Thu, 22 Jul 2010 15:25:00 -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=jNXpNAa1yG7qbtiZN6BRneyCbsg6cTKYd7rY7JhPZHo=; b=cc76SWvZeNJXVvSZQ+9jo/UkKxy0vzlFS9McPuXPxzrM/HVvisX26dj3KUhyneUwAk gez6fpGGYMVbSTxCHrvbsp7zXdnKcpyKFN9RV11ZMTxLEG+D97aA0klgi8EcXqEQmwWu a9715YbZZOU3I4MfTyA4G+6dtKv5erHvbReGQ= 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=nwx0zTQ3+CzHIedwf++0xi2prhMrUPqPUYyylPpyxbgMKYehMox13fB+hgT1Ngxm8Q a5Gjv4E1RodTZyZhh1DD7izyiQ4pzf/Lqic/7fNWT+tAspbAYfKmePyvsN3jc0vOk112 AZRl65RdQG44NGJwoXy9reYzwJNW+xB1kL3fs= Received: by 10.227.142.132 with SMTP id q4mr2587574wbu.90.1279837500271; Thu, 22 Jul 2010 15:25:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.87.210 with HTTP; Thu, 22 Jul 2010 15:24:40 -0700 (PDT) In-Reply-To: References: From: Michael Smith Date: Thu, 22 Jul 2010 23:24:40 +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/alternative; boundary=0016e659f4f292ec50048c0163c3 X-Virus-Checked: Checked by ClamAV on apache.org --0016e659f4f292ec50048c0163c3 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thanks Gerald, That's good to know for the future. Is there a way to know if the code has 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 > > > --0016e659f4f292ec50048c0163c3 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thanks Gerald,

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 the same code both directly and via Execute.
<= br>
Michael

On Wed, Jul 21, 2010 a= t 10:19 AM, Gerald Richter - ECOS <gerald.richter@ecos.de> wrote:

Hi Mi= chael,

=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 reques= t

=A0

Gerald

=A0

=A0

=A0

From:= Michael Smith [mailto:smithm@gmail.= com]
Sent: Wednesday, July 21, 2010 11:05 AM

Cc: Michael Stevens; cabell.demarcellus@dianomi.com; Michael Smit= h
Subject: Re: @param seems to be shared between Execute calls

=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 ma= ke a subsequent request for get.epl (in=A0practice=A0it's a bit more random than that if one is running multiple processes, so I make a few requests fo= r 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 Exe= cute calls, between which it is very definitely NOT called.

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

--
Ed Grimm
Identity Services


From= :

Michael Stevens <michael.stevens@dianomi.com>

To:<= /span>

embperl@perl.apache.org

Cc:<= /span>

Michael Smith <= michael.smith@dianomi.com>, cabel= l.demarcellus@dianomi.com

Date= :

07/20/2010 10:12 AM

Subj= ect:

@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


--0016e659f4f292ec50048c0163c3--