summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Vincent <jesse@bestpractical.com>2009-08-03 12:06:00 +0100
committerDavid Mitchell <davem@iabyn.com>2009-08-03 23:20:17 +0100
commit665455eb6413accb63ed59c02956aa88991b146a (patch)
tree2004d933fe1c31274480823d8f95a48742173397
parent5565aa0fd18bea8407d9a41a7801439ce180344f (diff)
downloadperl-665455eb6413accb63ed59c02956aa88991b146a.tar.gz
Update the description of the 'system' function to point users at autodie
pjf++ for complaining about the POD for system during his Klingon Programming talk at YAPC::EU 2009 (cherry picked from commit 1af1c0d6fc56624ceeee486b9d34f20643ac0ecd)
-rw-r--r--pod/perlfunc.pod7
1 files changed, 5 insertions, 2 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index bf22584eab..b3c076d245 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -6455,6 +6455,9 @@ C<qx//>, as described in L<perlop/"`STRING`">. Return value of -1
indicates a failure to start the program or an error of the wait(2) system
call (inspect $! for the reason).
+If you'd like to make C<system> (and many other bits of Perl) die on error,
+have a look at the L<autodie> pragma.
+
Like C<exec>, C<system> allows you to lie to a program about its name if
you use the C<system PROGRAM LIST> syntax. Again, see L</exec>.
@@ -6467,8 +6470,8 @@ value.
system(@args) == 0
or die "system @args failed: $?"
-You can check all the failure possibilities by inspecting
-C<$?> like this:
+If you'd like to manually inspect C<system>'s failure, u can check all
+possible failure modes by inspecting C<$?> like this:
if ($? == -1) {
print "failed to execute: $!\n";