2;0 juerd@ouranos:~$ rm karmatest 2;0 juerd@ouranos:~$ perl test.pl Use of uninitialized value in addition (+) at test.pl line 31. 2;0 juerd@ouranos:~$ cat test.pl #!/usr/bin/perl -w package Karma; use GDBM_File; use strict; sub new($$){ my ($prot, $file) = @_; my $self = { hash => {} }; $self->{object} = tie %{ $self->{hash} }, 'GDBM_File', $file, GDBM_WRCREAT, 0640; bless $self, $prot; return $self; } sub resolve($$){ my ($self, $subject) = @_; $subject = lc $subject; my $recur = 0; if (defined $self->{hash}{$subject}){ while ($self->{hash}{$subject} =~ /^S:(.*)/){ $subject = 'ERECURSIE', last if ++$recur > 10; $subject = lc $1; } } # The next line was put in to work around the warning. # $self->{hash}{$subject} = 0 unless defined $self->{hash}{$subject}; return \ $self->{hash}{$subject}; } sub incr($$;$){ my ($self, $subject, $d) = @_; #line 31 return ${ $self->resolve($subject) } += defined($d) ? $d : 1; } sub decr($$;$){ my ($self, $subject, $d) = @_; return ${ $self->resolve($subject) } -= defined($d) ? $d : 1; } sub get($$){ my ($self, $subject) = @_; my $foo = ${ $self->resolve($subject) }; print "BLAAT: $foo\n"; return $foo; } sub set($$$){ my ($self, $subject, $new) = @_; return ${ $self->resolve($subject) } = $new; } sub reorganize($){ $_[0]->{object}->reorganize(); } 1; package main; my $karma = Karma->new('karmatest'); $karma->incr('foo'); # foo must not exist #### 2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$