in reply to selective warnings
$ perl -le 'use warnings; if (!undef) { print "foo" }' foo [download]
No warning from !undef.
So first you should find out what's the cause for the warning.
Then you can read perllexwarn on how to disable warnings selectively.