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"; }