in reply to compile error in perl script

There is no compile error in your script as posted:

$ perl -c 1172320.pl 1172320.pl syntax OK

That's not to say there aren't runtime errors or warnings or algorithmic problems. But what you don't have are any errors in compilation.