This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix documentation for exec's warning behavior
authorEric Brine <ikegami@adaelis.com>
Sat, 3 Mar 2012 02:47:39 +0000 (18:47 -0800)
committerRicardo Signes <rjbs@cpan.org>
Mon, 5 Mar 2012 16:03:42 +0000 (11:03 -0500)
This should self-consistently and correctly identify when exec
will warn.

[ commit message rewritten by rjbs ]

pod/perlfunc.pod

index 4fd0a3a..08db117 100644 (file)
@@ -1944,10 +1944,10 @@ returns false only if the command does not exist I<and> it is executed
 directly instead of via your system's command shell (see below).
 
 Since it's a common mistake to use C<exec> instead of C<system>, Perl
-warns you if there is a following statement that isn't C<die>, C<warn>,
-or C<exit> (if C<-w> is set--but you always do that, right?).   If you
-I<really> want to follow an C<exec> with some other statement, you
-can use one of these styles to avoid the warning:
+warns you if C<exec> is called in void context and if there is a following
+statement that isn't C<die>, C<warn>, or C<exit> (if C<-w> is set--but
+you always do that, right?).  If you I<really> want to follow an C<exec>
+with some other statement, you can use one of these styles to avoid the warning:
 
     exec ('foo')   or print STDERR "couldn't exec foo: $!";
     { exec ('foo') }; print STDERR "couldn't exec foo: $!";