in reply to Finding pages without specific words
Your if tests are also using the wrong operator.
if ( $line !~ /$nameOne/i ) [download]
'!~' rather than '!=' Running with Warnings enabled would have shown this error. :)
Wonko