in reply to Reading contents of file using regex

Also removing all characters in the $t_book '$t_book=~s/.//g;' will not help when doing the matching later. I think you think meant to do this '$t_book=~s/\.//g;'?