in reply to $_ is null in Tk:Scrolled search?

I think you have already found your bug here. Why would you expect $_ to be varying while this code is being executed. The outermost foreach binds $word to each member of @words, and the while statement is checking the value of $from.

So, you tell me what the purpose of the if statement is.

--
I'm Not Just Another Perl Hacker

Replies are listed 'Best First'.
Re: Re: $_ is null in Tk:Scrolled search?
by Elijah (Hermit) on Dec 08, 2003 at 17:54 UTC
    I understand that $from returns an integer value representing the line number and character number of the first character in the latched word. However I need a way to search each string the "search" function in the while loop is searching so I can check for a comment character. Maybe I can just add this check to the while loop statement. Basically I need to check if a commented string is on the same line as the found matched $word. If it is I am sure you can see from my code what I want to do. If not I simply want to test if the coordinates of the comment character is after the $from of the matched word. If it is after then I know it is safe to color the matched word it's corresponding color. If the matched word is after a comment character (meaning it is part of a commented string) then I do not want to color it.