mrityunjaynath has asked for the wisdom of the Perl Monks concerning the following question:
Hello everyone ....i have a written a code where i would take up the value form a config.txt file and use those value further. The code is working fine but every time it runs along with the correct output it is also giving some warning like
use of uninitialized value $key in hash element at newperlfile.pl line 85, <$CFILE> line 3
my config.txt file reads like this
chipid::1925
subversid::0001
the code portion is here with and line 85 being marked *****
please put some light as i am not able to solve thismy $cChipId; my $cSubVersId; my %data_ids; my $readline; open (my $CFILE,"config.txt" ) || die "couldnt open file: $!"; while ($readline = <$CFILE>) { chomp $readline; my ($key , $value) = (split /::/, $readline); $data_ids{$key} = $value; ***** } close($CFILE); for my $key (keys %data_ids) { $cChipId = $data_ids{'chipid'}; $cSubVersId = $data_ids{'subversid'}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: use of uninitialized value in hash element problem
by 1nickt (Canon) on Jun 26, 2015 at 11:53 UTC | |
by afoken (Chancellor) on Jun 26, 2015 at 13:06 UTC | |
by 1nickt (Canon) on Jun 26, 2015 at 13:26 UTC | |
by mrityunjaynath (Acolyte) on Jun 26, 2015 at 12:06 UTC | |
|
Re: use of uninitialized value in hash element problem
by hippo (Archbishop) on Jun 26, 2015 at 12:23 UTC | |
|
Re: use of uninitialized value in hash element problem
by stevieb (Canon) on Jun 26, 2015 at 13:47 UTC |