in reply to upgrade to 5.8.4 breaks code -- how to fix?

Funny, with Perl 5.8.3, the following doesn't generate any kind of error (nor should it):

perl -e 'BEGIN { my %x = (); }'

And in reading perldelta for version 5.8.4, the only change to how   my %x = (); is handled is that the unnecessary initialization to the empty set is optimized away, which also shouldn't cause any errors.

Are you sure that those three lines, by themselves, generate the error you've described? I don't have 5.8.4 installed anywhere to confirm, but unless there's a bug in Perl, the code you presented should be just fine.

UPDATE: Ok, now that corion has confirmed it (and yes, I think it has to be related to the new optimization), who's going to submit the bug report? This code shouldn't generate an error, it's legitimate code.


Dave

Replies are listed 'Best First'.
Re^2: upgrade to 5.8.4 breaks code -- how to fix?
by bcrowell2 (Friar) on Jun 05, 2004 at 16:28 UTC
    Thanks, davido and Corion, for the help! Corion's workaround does indeed fix the problem for me. I'd be interested in having the experience of reporting the bug, but what's the correct way to do it -- dash off an e-mail to Larry Wall, or is there a bugzilla or a mailing list or something? Corion clearly has more Perl-fu than I do, so if Corion wants to handle the bug report instead of me, that's fine too.

      The proper way to go about reporting a bug (possibly after having verified it with other people, as you did) is to run perlbug, and type/paste in your bug report. Note that I didn't check http://rt.perl.org/perlbug/ for a possible duplicate, so your bug report might duplicate some already existing open bug report.

      So, in your case, do that, paste in your snippet, or better the oneliner snippet I used, add some description of what you expected to happen, and what happened, and add the link to the root node here for further reference.

      perlbug will then send a mail to the perl5-porters mailing list in your name, and a bug ticket on http://rt.perl.org/perlbug/ will also be created automagically.

      If all goes well, you'll either hear back directly from somebody who fixed your bug or you'll find it fixed in Perl 5.8.6 ...

        Thanks for the info, Corion! I'll go ahead and report the bug.