httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: Failures in with A::T 1.09
Date Wed, 10 Mar 2004 22:42:45 GMT
William McKee wrote:
> Hi Stas,
> I recently upgraded my workstation for A::T 1.07 to 1.09. Immediately
> upon doing so, I started to receive test failures. It turns out that
> these failures were due to lines 613 and 1573 of Apache::TestRun. The
> error was actually a warning as follows:
>   Statement unlikely to be reached at
>   /usr/local/lib/perl5/site_perl/5.8.2/i686-linux/Apache/ line
>   613.
> However, following the examples I've seen for TEST.PL, I had the
> following line in my TEST script:
>   use warnings FATAL => 'all';
> This caused the tests to fail. I tried reinstalling Apache::Test 1.07
> and 1.08 but neither made any difference. I don't know why this started
> showing up in 1.09, but it seems like it should be removed. I've
> attached a diff that comments out these lines.

That's strange. What kind of Perl build do you have? According to the exec 
manpage this is perfectly correct code:

        exec PROGRAM LIST
                The "exec" function executes a system command and never
                returns-- use "system" instead of "exec" if you want it to
                return.  It fails and returns false only if the command does
                not exist and it is executed directly instead of via your sys-
                tem's command shell (see below).

                Since it's a common mistake to use "exec" instead of "system",
                Perl warns you if there is a following statement which isn't
                "die", "warn", or "exit" (if "-w" is set  -  but you always do
                that).   If you really want to follow an "exec" with some other
                statement, you can use one of these styles to avoid the warn-

                    exec ('foo')   or print STDERR "couldn't exec foo: $!";
                    { exec ('foo') }; print STDERR "couldn't exec foo: $!";


   exec $foo;
   die "shouldn't be reached";

should generate no warnings.

Do you get this problem when running:

% perl -lwe 'use warnings; exec "echo ok"; die "should not be reached"'

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message