Subject: | badly formed key causes uninitialized value warnings |
Hi,
in get() the case where the input doesn't match the regexp:
my $key = $1 if ( $rkey =~ s/^\/([^\/|\[]+)//o );
(leading to $key = undef) isn't caught, leading to warnings further on
when $key is being used.
Here's example code:
print Data::Path->new( { foo => 1 } )->get('goo'), "\n";
This results in
Use of uninitialized value in substitution (s///) at
/proj/axaf/ots/x86_64-linux_debian-4.0/lib/perl/5.8.8/Data/Path.pm line 70.
Use of uninitialized value in hash element at
/proj/axaf/ots/x86_64-linux_debian-4.0/lib/perl/5.8.8/Data/Path.pm line 77.
Use of uninitialized value in exists at
/proj/axaf/ots/x86_64-linux_debian-4.0/lib/perl/5.8.8/Data/Path.pm line 81.
Use of uninitialized value in concatenation (.) or string at
/proj/axaf/ots/x86_64-linux_debian-4.0/lib/perl/5.8.8/Data/Path.pm line 22.
key does not exists
at cfggen2sh line 1