sub DESTROY { my $self = shift; close $self; print "Closed!\n"; # just to prove that it's working }