if ( ($newLine =~ /$/)[0] # always true, returns 1 eq /(\w+)$/ # returns 1 if $_ ends in word, "" if not ) { ... }