tqisjim has asked for the wisdom of the Perl Monks concerning the following question:
I'm running an older version:
This is perl, v5.8.9 built for i686-linux
Here's sample script:
Here's what happens when I run the script:use Switch ; $perldata = bless { hello => 'world' }, 'superman' ; # $perldata = { hello => 'world' } ; sub test { my $o = shift ; warn $o ; my $m = bless { perldata => $o }, 'TQIS::test' ; return $m ; } sub TQIS::test::DESTROY { my $self = shift ; warn $self->{perldata} ; } $a = test( $perldata ) ; $b = test( $perldata ) ; $c = test( $perldata ) ;
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$ 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. $
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: use Switch wierdness
by runrig (Abbot) on Aug 24, 2012 at 22:28 UTC | |
by tqisjim (Beadle) on Aug 25, 2012 at 01:35 UTC | |
Re: use Switch wierdness
by GrandFather (Saint) on Aug 25, 2012 at 02:36 UTC | |
Re: use Switch wierdness
by Anonymous Monk on Aug 25, 2012 at 07:08 UTC | |
by tqisjim (Beadle) on Aug 27, 2012 at 14:49 UTC | |
(OT) Re: use Switch wierdness
by Athanasius (Archbishop) on Aug 25, 2012 at 08:07 UTC | |
by tqisjim (Beadle) on Aug 27, 2012 at 13:43 UTC |
Back to
Seekers of Perl Wisdom