in reply to Re^2: Injecting a filter into warn()
in thread Injecting a filter into warn()

You could use warnings instead of using -w. -w affects all lines processed by perl, no matter which module its parsing at the moment. use warnings only affects the module (or block) in which its located.