in reply to Re^3: warning: use of uninitialized value
in thread warning: use of uninitialized value
hii athanasius i have tried something on the above code . its working but when i have printed $chipID it prints cChipId and $cSubVersId gives 1925 (in last two lines of code ) while the value i have provided through config text ChipId 1925 and SubVersId 0003. so its problemetic output. no warning this time though
thanksmy @words; my $readline; my $cChipId; my $cSubVersId; if(open (my $CFILE,"config.txt" ) || die "couldnt open file:", $! ) { $readline = <$CFILE>; chop($readline); if (defined $readline ) { @words = split(/ /,$readline); $readline = <$CFILE>; chop($readline); } $cChipId = $words[0]; $cSubVersId = $words[1]; print "$cChipId \n"; print "$cSubVersId \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: warning: use of uninitialized value
by Athanasius (Archbishop) on Jun 25, 2015 at 13:39 UTC | |
by u65 (Chaplain) on Jun 25, 2015 at 17:14 UTC | |
by hippo (Archbishop) on Jun 25, 2015 at 19:22 UTC | |
by u65 (Chaplain) on Jun 25, 2015 at 20:18 UTC | |
by mrityunjaynath (Acolyte) on Jun 26, 2015 at 04:00 UTC | |
by robby_dobby (Hermit) on Jun 26, 2015 at 05:05 UTC | |
by mrityunjaynath (Acolyte) on Jun 26, 2015 at 05:26 UTC | |
by robby_dobby (Hermit) on Jun 26, 2015 at 05:47 UTC | |
|