in reply to undefined value and orphaned memory with IPC::Shareable
I'd say your $self->{_data} is not defined at this point. you can just assign an empty list to prevent this:446: return scalar(@{$self->{_data}});
use IPC::Shareable (':lock'); my @arr; my %options = ( create => 'yes', mode => 0644, exclusive => 0, destroy => 'yes' ); my $handle = tie @arr, 'IPC::Shareable', 'dat1', { %options } or die " +Tie failed.\n"; @arr = (); # INITIALIZE <----------- if (@arr) { print "NOT empty\n"; }
|
|---|