in reply to Re^3: (weird dup - please reap) Parsing and Obtaining Values from output
in thread Parsing and Obtaining Values from output
Hi
note: the following is not intended to be a fix to your program; instead I try to show you a few steps you could have done to identify faulty/suspicious parts of your program...
First, you have not followed the golden rule to
Then you would have found out some obvious mistakes likeuse strict; use warnings;
Secondly, you use debug-output, which is fine ... however it is not detailed enough; e.g.for (@myarray1) { last if $conf eq $_; $i++; };
Here you can't easily see that the array @values might not contain what you want (but many empty elements addtionally). This leads to many unitialized values in the further run of your program. You could use something like print join("XXX\n", @values);print "Values is @values \n";
If you look at your debug-output to more detail, you would see that the first (non-empty) element of @values is
and0|0|{A=145,B=2,C=12,D=18}|!
... so your split is not working as expected ...Conf is 0 Rest is 0
When debugging code, you should start from the beginning. Solve the points shown above. And only when you found a solution for those, continue by looking at the rest of the program. It will be much easier that way.
HTH, Rata
|
|---|