$ perl /tmp/err.pl
superman=HASH(0x9b0d18c) at /tmp/err.pl line 8.
superman=HASH(0x9b0d18c) at /tmp/err.pl line 8.
superman=HASH(0x9b0d18c) at /tmp/err.pl line 8.
superman=HASH(0x9b0d18c) at /tmp/err.pl line 15 during global destruct+ion.
superman=HASH(0x9b0d18c) at /tmp/err.pl line 15 during global destruct+ion.
Warning: something's wrong at /tmp/err.pl line 15 during global destru+ction.
$

If I comment out the 'use Switch' statement, the superman reference prints out correctly 3 times on line 15. Incidentally, I also get the correct result of the variable perldata is not blessed.
I'm guessing this is a bug. Does anybody else experience the same thing?
-Jim

Switchis a bug (this statement is an exaggeration, but see Categorized Damian Modules...maybe 'Switch is a bug waiting to happen'??). Don't use it in production. Even if it was (mistakenly) once a core library. (if you're not using it or considering using it for any serious purpose and just experimenting, please state that in your post...sorry and move along).

If I understand your explanation correctly, using a blessed or unblessed version of $perldata may only re-arrange an indeterminate destruction order, and therefore not a reliable solution. But then you took the same approach with your command line switch... Can you explain?

Based on my observation, the superman object is destroyed when expected, after all the referencing objects. It's not that the references point to a destroyed object so much as the references themselves are getting clobbered. I'm probably digging too deep- If I have to think this hard in Perl, I must be taking the wrong approach.

Finally, thanks for the heads up about weak references. I was not aware of them.