The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
use Test::More;
use t::Capture;
use CGI::Compile;

my $sub = CGI::Compile->compile("t/warnings.cgi");

my $stdout = do {
    local $^W = 0;

    capture_out($sub);
};

like $stdout, qr/\s*1\z/, '-w switch preserved';

done_testing;