Name "main::INFILE" used only once: possible typo at a.pl line 18. readline() on unopened filehandle INFILE at a.pl line 18.