in reply to regex end of line

Your code is quite broken. It's not doing what you're trying to do at all.
if ( ($newLine =~ /$/)[0] # always true, returns 1 eq /(\w+)$/ # returns 1 if $_ ends in word, "" if not ) { ... }
You just want to say: if ($newLine =~ /\w$/) { ... }. That checks to see if $newLine ends in a word character. Maybe you even want /\w{2}$/ instead, to ensure at least two word characters.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a job (NYC-area)
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;