use strict; use warnings; package A; use base 'Exporter'; our @EXPORT = qw(%hash); use IPC::Shareable; $SIG{INT} = sub { print "package A has caught the INT signal\n"; IPC::Shareable->clean_up_all; exit; }; $SIG{__DIE__} = sub { print "package A has caught the die() signal\n"; IPC::Shareable->clean_up_all; exit; }; our %hash; my $tied; BEGIN { $tied = tie %hash, 'IPC::Shareable', { key => 'test', create => 1 }; } END { IPC::Shareable->clean_up_all; } sub run { print "A: "; print "a: $hash{a}, a: $hash{b}\n"; } 1;