To echo what marto states above, you do not need both #!perl -w and use warnings. In fact, they do slightly different things.
- #!perl -w causes warnings to be turned on for the duration of the program, through all included modules, even those not using the warnings pragma. This can generate warnings from modules that you have no control over.
- use warnings will turn on warnings from the point of the pragma directive until the close of the file, the close of the enclosing block (if included within {...}), or a no warnings pragma directive (subject to scoping rules).
I personally would stick with use warnings and dump the -w from your shebang line.