So, here is how you can generally debug a perl program. There may be many other ways but these are some ways of doing it.
perl -c #syntax check, program not executed.
perl -w #print warnings, Checks variable names, scalar variable, subroutine and filehandles.
use warnings; #controlling warnings.
warn “Somethings wrong here!!”;
perl -d program.pl
If you like this article, then please consider sharing it. Sharing really inspires us to do things much better!!