Coming from a C++ background, I religiously use the use strict and use warnings features of Perl:
use strict
use warnings
#!/usr/bin/perl -w use strict; us
Try this:
perl -MO=Lint -cw /path/to/script.pl
This uses the B::Lint module.