in reply to Re^2: Who is turning $^W on?
in thread Who is turning $^W on?

While not very pretty, this seems to work when added at the top of the test file:

BEGIN { $^W = 0 }

Test::Harness lets you add command-line switches by setting the HARNESS_PERL_SWITCHES environment variable. But that doesn't work for removing the warnings, because it is just added to the existing switches.

Replies are listed 'Best First'.
Re^4: Who is turning $^W on?
by itub (Priest) on Nov 20, 2004 at 03:54 UTC
    Sorry to reply to myself, but I've noticed that the HARNESS_PERL_SWITCHES variable may be useful for this after all, because the -X command line option overrides the -w option and disables all warnings. Just do the following:

    HARNESS_PERL_SWITCHES=-X make test

    But if you still wanted to keep the lexical warnings this won't do what you want, because it disables them as well.