use IPC::Shareable ':lock'; [...] no warnings 'untie'; my $knot; my $glue = "SHMEMGLUE"; eval { $knot = tie %tie, 'IPC::Shareable', $appdata{$glue}, { create => 0, mode => 0666, size => $appdata{SHMEMSIZE}, exclusive => 0, destroy => 0 }; }; unless ($@) { $knot->remove; untie %tie; undef $knot; } $knot = tie %tie, 'IPC::Shareable', $appdata{$glue}, { create => 1, mode => 0666, size => $appdata{SHMEMSIZE}, exclusive => 0, destroy => 0 }; untie %tie;