Skip to content

Instantly share code, notes, and snippets.

@exodist
Created September 11, 2014 04:40
Show Gist options
  • Save exodist/45b8cf32780a5dd7a66b to your computer and use it in GitHub Desktop.
Save exodist/45b8cf32780a5dd7a66b to your computer and use it in GitHub Desktop.
Whoa!
use strict;
use warnings;
{
package Foo;
sub finish {
$_[0] = undef;
}
sub DESTROY {
print "Bye Bye\n";
}
}
my $one = bless {}, 'Foo';
print "A: $one\n";
$one->finish;
print "B: $one\n";
__END__
perl test.pl
A: Foo=HASH(0x2123148)
Bye Bye
Use of uninitialized value $one in concatenation (.) or string at test.pl line 22.
B:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment