in reply to Exact string match
I'm not exactly clear on what you're going for here, so I'll just give the short answer. What your're looking for is eq, not a regular expression. In other words, $row =~ /out.h/ will search for things containing the string "out", followed by any single charater, followed by "h". Not only is this not what you want because it matches any substring, but because '.' is a regex metacharater that means "any single character" (other then newline, in some curcimstances). $row eq 'out.h', however, will only succeed (return true) when $row is exactly equal (stringishly speaking) to 'out.h'.
In not clear on what $m is doing there, but I think what you want is if ($row eq $names[$k]).
|
|---|