Closed p5pRT closed 20 years ago
perl -wle 'use Data::Dumper; my $nn=0; print Dumper({index=> $nn\,offset=> ++$nn})'
prints
$VAR1 = { 'offset' => 1\, 'index' => 1 };
perl -wle 'use Data::Dumper; my $nn=0; print Dumper({index=> $nn+0\,offset=> ++$nn})'
$VAR1 = { 'offset' => '1'\, 'index' => '0' };
Now\, I know this is strictly speaking not a bug. Perl is like C in this respect\, and I should not have depended on the order in which sideeffects are done.
Having said that\, I always understood that perl basically executes it's ops in the order they are given\, so I would have expected (1\,0) in both cases\, so I was in fact surprised by the output.
I mention it in a bugreport because someone understanding optrees should maybe have a quick think if this is indeed ok.
If it is ok\, you can use it as a warning example in the docs to be wary of side effects :-)
In article \20010222055925\.20776\.qmail@​quasar\.home\.lunix\, me-01@ton.iguana.be writes:
This is a bug report for perl from thospel@mail.dma.be\, generated with the help of perlbug 1.31 running under perl v5.6.0.
Ok\, so I took a look at the optree myself. Absolutely no bug here\, move on\, no bugs here.
How do a close a bug report ?
----------------------------------------------------------------- [Please enter your report here]
perl -wle 'use Data::Dumper; my $nn=0; print Dumper({index=> $nn\,offset=> ++$nn})'
prints
$VAR1 = { 'offset' => 1\, 'index' => 1 };
perl -wle 'use Data::Dumper; my $nn=0; print Dumper({index=> $nn+0\,offset=> ++$nn})'
$VAR1 = { 'offset' => '1'\, 'index' => '0' };
Now\, I know this is strictly speaking not a bug. Perl is like C in this respect\, and I should not have depended on the order in which sideeffects are done.
Having said that\, I always understood that perl basically executes it's ops in the order they are given\, so I would have expected (1\,0) in both cases\, so I was in fact surprised by the output.
I mention it in a bugreport because someone understanding optrees should maybe have a quick think if this is indeed ok.
At 06:27 +0000 2001.02.22\, Ton Hospel wrote:
Ok\, so I took a look at the optree myself. Absolutely no bug here\, move on\, no bugs here.
How do a close a bug report ?
Do we have a volunteer to be a bug admin person? :) Richard Foley handles all that. Should be accessible at richard@perl.org.
Migrated from rt.perl.org#5888 (status was 'resolved')
Searchable as RT5888$