in reply to Syntax error

Have a look at

}end if # ******************************************************************** +****** # OPTION 2 - Obtain and process input sentences provided in user file. # ******************************************************************** +****** elsif ($option == 2)

you should find the problem. Strip all unnecessary lines away and you'll keep your hairs... ;-)

Best regards
McA