From: Ian Campbell Subject: Re: [PATCH OSSTEST] PDU/xenuse: Support xenuse on machine not locked by current user Date: Thu, 17 Oct 2013 11:53:09 +0100 Message-ID: <1382007189.18128.39.camel@kazak.uk.xensource.com> References: <1381939110-30213-1-git-send-email-ian.campbell@citrix.com> <21087.47915.599553.193298@mariner.uk.xensource.com> <1382006008.18128.38.camel@kazak.uk.xensource.com> <21087.49280.629810.133975@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <21087.49280.629810.133975@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2013-10-17 at 11:48 +0100, Ian Jackson wrote: > Ian Campbell writes ("Re: [PATCH OSSTEST] PDU/xenuse: Support xenuse on machine not locked by current user"): > > On Thu, 2013-10-17 at 11:25 +0100, Ian Jackson wrote: > > > 1. Perl dynamic scoping ("local"): > > > > > > { > > > local $ENV{USER} = $user; > > > system_checked($xenuse, "--$onoff", "$mo->{Host}{Name}"); > > > } > > > > > > IMO this is idiomatic Perl. > > > > I tried this and it didn't work. I think local causes $ENV to loose its > > magic properties. > > mariner:~> perl -e '{ local $ENV{USER}="foo"; system "printenv"; }; system "printenv"' | grep USER= > USER=foo > USER=iwj > mariner:~> > > I'm not sure what you tried... Essentially the same thing, or so I thought. Looks like I either buggered it up or misinterpreted the results! Ian.