## how does this happen? I thought that assigning $testob to a string or calling undef would remove any reference to the memory location of the object, but it is clear here that $blah in the "object" retains this as does $testob?? please enlighten me! thanks in advance.## the test script use Report::testob; my $testo; $x=0; while($x<10){ undef $testo; $testo="ooof"; $testo=testob->new(); $testo->printblah(); $testo="yess"; $x++; } ##### # the "object" package testob; sub new { my $class=shift; my $self={@_}; bless($self,$class); return $self; } sub printblah{ my $self=shift; $blah++; $self->{blah}++; print "blah is $blah \n"; print "self blah is ".$self->{blah}."\n"; } 1; ##### # the output blah is 1 self blah is 1 blah is 2 self blah is 1 blah is 3 self blah is 1 blah is 4 self blah is 1 blah is 5 self blah is 1 blah is 6 self blah is 1 blah is 7 self blah is 1 blah is 8 self blah is 1 blah is 9 self blah is 1 blah is 10 self blah is 1
In reply to Undef doesnt work?This has got me stumped by pike_uk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |