in reply to Re^3: Hash making
in thread Hash making

Let's look at the following code. Up to counter1++ and forget the rest for now. with the conditions set (unless), I am taking those lines that are qualified. Counter1 gives me the number of counts for those lines (value for a hash). If I can iterate through $current_line14 >= and change the value of 3 (which is fixed here) I will get different counts. Therefore by each change at value of current_line14 >= you will get a different count. So your hash keys become your loop values from 3..30 for example and values will be the number of lines extracted. If I want to change "3" manually I have to perform the while loop 20 - 30 times for each key in order to get the counts.
while(<INPUT2>){ chomp; my @current_line = split /\t/; # eliminate unqualified lines early next unless $current_line[5] == 1 && $current_line[14] >= 3; $counter1++; if ($file1{ $current_line[1]}) { my ($from, $to) = @{ $file1{ $current_line[1] } }; for ($from <= $current_line[2] && $current_line[2] <= $to) { print join("\t", $current_line[1],$current_line[5],$current_line[14 +], "***",$current_line[2]), "\n"; $lines++; } } }

Replies are listed 'Best First'.
Re^5: Hash making
by ikegami (Patriarch) on Sep 21, 2008 at 19:20 UTC

    Don't speak in terms of your code (which is broken), speak in terms of your inputs (of which you haven't even shown a sample).

    I might find an answer to some of my questions in what you posted if I ponder long enough, but I'm more likely to come up with more questions than answers. Why do you think you can express yourself better in Perl than in English.

    In short, I'm still waiting for answers to my questions. Or feel free to start over while avoiding posting code.