Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
IPC::ShareLite documentation states that you can get a share's segment size:
my $size = $share->size;
but $share->size always returns 0.
Example:
use strict; use warnings; use IPC::ShareLite; use Storable qw( freeze thaw ); my $share; eval { $share = IPC::ShareLite->new( -key => 4812, -create => 'yes', -destroy => 'no', -mode => 0600, ); }; if ($@) { warn "Woops: $@"; exit; } # Let's use some memory my @array = 0 .. 1500000; $share->store( freeze( \@array ) ); my $size = $share->size; print "Size: $size\n"; my $num_segments = $share->num_segments; print "Segments: $num_segments\n";
which yields:
Size: 0 Segments: 207
Any hints are very appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: IPC::ShareLite - getting a shares size
by zentara (Cardinal) on May 17, 2012 at 20:16 UTC | |
by tomfahle (Priest) on May 17, 2012 at 20:56 UTC |