in reply to Delete shares with IPC::Shareable

It works when I call the clean_up method manually. This is not perfect, but seems to work, here's the code:
#!/opt/perl/bin/perl -w use IPC::Shareable; my %options = ( create => 1, exclusive => 0, mode => 0644, destroy => 0 ); tie %data, 'IPC::Shareable', 'data', { %options }; my $i = 0; while (1) { print $i++."\n"; %data = (); IPC::Shareable->clean_up(); tie %data, 'IPC::Shareable', 'data', { %options }; $data{test}{'test'} = $i; sleep 1; }


giant

Replies are listed 'Best First'.
Re^2: IPC::Shareable -> Workarround
by Aristotle (Chancellor) on Oct 25, 2002 at 23:31 UTC
    Slightly less duplicated code and processing, also strict compliant:
    #!/usr/bin/perl -w use strict; use IPC::Shareable; my $options = { create => 1, exclusive => 0, mode => 0644, destroy => 0 }; my $i = 1; while (1) { print "$i\n"; tie my %data, 'IPC::Shareable', 'data', $options; $data{test}{test} = $i++; sleep 1; %data = (); IPC::Shareable->clean_up(); }

    Makeshifts last the longest.