data.txt hello.pl~45~warning~454~null pointer hello.pl~43~warning~454~memory hello.pl~4532~warning~454~badpointer hello.pl~22~warning~454~null pointer hello.pl~88~warning~454~null pointer #### lineChanged.txt 22-33 90 42-44 100 #### hello.pl~43~warning~454~memory hello.pl~22~warning~454~null pointer #### while () { chomp; # split the line from the spaces # $file is file name like hello.pl $info = $_; is it a range or a single line? if ($info =~ /(\d+)-(\d+)/) { $changes{$file} .= " ".join(" ",($1 .. $2))." "; } else { $changes{$file} .= " $info "; } if (defined $changes{$file}) { # was it a range? if (defined $changes{$file}->[1]) { # skip if this $line is not in this range next unless ($line gt $changes{$fill}->[0] and $line lt $changes{$file}->[1]); } else { # skip if this $line is not equal to this single line number next unless $line eq $changes{$file}->[0]; } # if we are here, then this is a match. so print it. print "############ Here ################\n"; # print "$_\n"; #print "############ Here ################\n"; }