in reply to Data extraction with specific keywords
What is suspicious at the first glance is the following code: if ($arr[$i] == $ar)
I believe that the array in question stores strings, not numbers. Did you mean this? if ($arr[$i] eq $ar)
Also, $c is a scalar (line 4), however later on you are presenting it as an array: $c[$j]=$i;, what is up with that?
I would strongly suggest adding this at the top, and start from there, eliminating things interpretter will complain about, one by one.
Good luck, and have patience!
use strict; use warnings;
I would contradict what other fellow monks suggested, and suggest you to start slowly from scratch, as the code is too "strange" for me to comprehend what is it you actually need it to do. Debugging the program in question in smaller chunks could probably help. Perhaps this might also help:
|
|---|