..
use strict;
use warnings;
...
my (%customer);
%customer = ();
...
17 sub _customer_id {
18 my $customer_r = shift;
19 unless(defined $customer{$customer_r}){
20 $customer{$customer_r} = ++$customer_id;
21 }
22 $customer{$customer_r};
23 }
I’m just checking whether some hash key exists.
But getting the Use of uninitialized value in hash element at line 19,20,22.
Why?
This error means
$customer_risundef.How are you calling this function?