if ( ($newLine =~ /$/)[0] eq /(\w+)$/ ) { print " the line $newLine\n"; } #### yty~uyuoo~iu99~##uyt~hu/dwo9