package Apache::Session::Derived::Class; use strict; our $VERSION = '1.00'; our @ISA = qw(Apache::Session); use Apache::Session; ... sub populate { my $self = shift; ... return $self; } sub DESTROY { my $self = shift; local $@; eval { $self->save; }; if ( $@ ) { my $error = $@; my $msg = q{Can't call method ".*?" on an undefined value at } . q{.*?/Apache/Session\.pm line \d+ during global destruction.}; if ( $error =~ m/$msg/ ) { warn "Unable to save session changes! (Closure around session?)\n"; } else { warn $error; } } $self->release_all_locks; } 1;