if ( ($newLine =~ /$/)[0] eq /(\w+)$/ ) { print " the line $newLine\n"; }