develooper Front page | perl.perl5.porters | Postings from March 2003

Re: [perl #21737] Variable scope affects variable interpretation with shell brace escapes

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
March 29, 2003 02:36
Subject:
Re: [perl #21737] Variable scope affects variable interpretation with shell brace escapes
Message ID:
20030329102909.GA14153@Bagpuss.unfortu.net
On Sat, Mar 29, 2003 at 01:10:26AM -0000, ckuskie@dalsemi.com (via RT) wrote:

> #!/usr/local/bin/perl
> 
> $a = "name";
> $b = 5;
> 
> my $c = "name";
> my $d = 5;
> 
> print ".D(${a}[$b])\n";
> print ".D(${c}[$d])\n";
> 
> outputs:
> 
> .D(name[5])
> .D([5])
> 
> When -w is turned on, then you get this:
> I've tried this on both 5.6.1 and 5.8.0 on Solaris 2.8, as well as Linux.

Thanks for the report. It's present at least as far back as 5.004_04
However, it's recently been fixed - the output of development perl is:

.D(name[5])
.D(name[5])

and this fix will be in the upcoming 5.8.1 release

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About