Return-Path: Delivered-To: apmail-perl-embperl-archive@www.apache.org Received: (qmail 96471 invoked from network); 11 Dec 2004 00:41:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Dec 2004 00:41:24 -0000 Received: (qmail 62947 invoked by uid 500); 11 Dec 2004 00:41:16 -0000 Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 62889 invoked by uid 500); 11 Dec 2004 00:41:15 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 62864 invoked by uid 99); 11 Dec 2004 00:41:15 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from 242.70.233.220.exetel.com.au (HELO dolly.pasture.com.au) (220.233.70.242) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 10 Dec 2004 16:41:12 -0800 Received: from amavis by dolly.pasture.com.au with no-scan (Exim 4.34) id 1CcvJp-0002jB-Uj for embperl@perl.apache.org; Sat, 11 Dec 2004 11:41:05 +1100 Received: from mongrel.pasture.com.au ([10.0.128.104]) by dolly.pasture.com.au with esmtp (Exim 4.34) id 1CcvJX-0002ic-VQ; Sat, 11 Dec 2004 11:40:49 +1100 Received: from localhost ([127.0.0.1] helo=mongrel.pasture.com.au) by mongrel.pasture.com.au with esmtp (Exim 4.34) id 1CcvJa-0002yo-Bl; Sat, 11 Dec 2004 11:40:50 +1100 Date: Sat, 11 Dec 2004 11:40:50 +1100 Message-ID: <87mzwl8y5p.wl%gus@inodes.org> From: Angus Lees To: wschroed@schroedernet.net Cc: embperl@perl.apache.org Subject: Re: session question In-Reply-To: <1102647924.11021.7.camel@mummer.localhost> References: <20041209194742.A9889125D27@lnx1.i.ecos.de> <1102647924.11021.7.camel@mummer.localhost> Mail-Followup-To: wschroed@schroedernet.net, embperl@perl.apache.org User-Agent: Wanderlust/2.11.30 (Wonderwall) XEmacs/21.4 (Security Through Obscurity) Mail-Copies-To: never MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N At Thu, 09 Dec 2004 21:05:24 -0600, Will Schroeder wrote: > 1: in a pattern match like [$ if ( $fdat{QC} =~ m/(\d+)/ ) $] > [- $num = $1 -] > for example. The $1 variable never seems to get populated during the > match like in a regular old perl script. aiui, the value of $1, etc variables are "lexically scoped" in perl. so this should work fine: [- if ( $fdat{QC} =~ m/(\d+)/ ) { $num = $1; } -] whereas your code gets turned into something more like this by embperl: if ( eval { $fdat{QC} =~ m/(\d+)/ } ) { eval { $num = $1 }; } so $1 loses its value across embperl blocks, in the same way that "my" variables, etc are also limited to a single embperl block (ignoring [* *] blocks for the moment). -- - Gus --------------------------------------------------------------------- To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org For additional commands, e-mail: embperl-help@perl.apache.org