- or download this
if (my $object = Foo->new) {}
print "after if\n";
...
package Foo;
sub new { my $self = bless {},shift; print "CREATED $self\n"; $self }
sub DESTROY { print "DESTROYED $_[0]\n" }
- or download this
CREATED Foo=HASH(0xfc65c)
after if
DESTROYED Foo=HASH(0xfc65c)
- or download this
CREATED Foo=HASH(0xfc65c)
DESTROYED Foo=HASH(0xfc65c)
after if
- or download this
use Internals qw(SetRefCount);
if (my $object = Foo->new) { SetRefCount( $object,1 ) }
...
DESTROYED Foo=HASH(0xfc65c)
after if
Attempt to free unreferenced scalar: SV 0xfc65c.
- or download this
{
if (my $object = Foo->new) { }
...
CREATED Foo=HASH(0xfc65c)
DESTROYED Foo=HASH(0xfc65c)
after if